feathers/packages/commons/test/module.test.ts
David Luecke c606c56dc2
chore: Format code using Prettier and updated ESLint rules (#2647)
Co-authored-by: Marshall Thompson <marshall@creativeideal.net>
2022-05-27 15:21:13 -07:00

29 lines
958 B
TypeScript

import { strict as assert } from 'assert'
import { _ } from '../src'
describe('module', () => {
it('is commonjs compatible', () => {
// eslint-disable-next-line
const commons = require('../lib')
assert.equal(typeof commons, 'object')
assert.equal(typeof commons.stripSlashes, 'function')
assert.equal(typeof commons._, 'object')
})
it('exposes lodash methods under _', () => {
assert.equal(typeof _.each, 'function')
assert.equal(typeof _.some, 'function')
assert.equal(typeof _.every, 'function')
assert.equal(typeof _.keys, 'function')
assert.equal(typeof _.values, 'function')
assert.equal(typeof _.isMatch, 'function')
assert.equal(typeof _.isEmpty, 'function')
assert.equal(typeof _.isObject, 'function')
assert.equal(typeof _.extend, 'function')
assert.equal(typeof _.omit, 'function')
assert.equal(typeof _.pick, 'function')
assert.equal(typeof _.merge, 'function')
})
})