assert-polyfill
v0.0.0
Published
an exterminate 'TypeError: undefined is not a function' you encounter in node-v0
Maintainers
Readme
Assert polyfill
Installation
npm install assert-polyfill --saveWhy?
NodeJS v0 deepStrictEqual/notDeepStrictEqual is unavailable.
var assert = require('power-assert');
assert.deepStrictEqual(['foo'], ['foo'])
// TypeError: undefined is not a function
assert.notDeepStrictEqual(['foo'], ['bar'])
// TypeError: undefined is not a functionif above function is undefined, assert-polyfill defines the polyfill functions.
require('assert-polyfill');
var assert = require('power-assert');
assert.deepStrictEqual(['foo'], ['foo']) // pass
assert.notDeepStrictEqual(['foo'], ['bar']) // passeven if --require in mocha, it is similar.
mocha --require assert-polyfillDevelopment
Requirement global
- NodeJS v0.12.13
- Npm v2.15.0
git clone https://github.com/59naga/assert-polyfill
cd assert-polyfill
npm install
npm test