2.0.2 (2023-04-20)
2.0.1 (2023-04-19)
2.0.0 (2022-08-01)
-
Variable Tracking
-
Restructured codebase
-
Performance improvement
- Replace AST matcher with simpler and robust logic
- Add Benchmark Suite to run benchmark continuously
- v2.0.0 is 20 times faster than v1.6.0
-
Newly supported syntaxes and features
unassert
function is removed in favor of named exports aiming ESM era. Please use unassert.unassertAst
instead.
before:
const unassert = require('unassert');
after:
const { unassertAst } = require('unassert');
Configuration options are simplified a lot. Patterns are aggregated into modules
.
before:
{
assertionPatterns: [
'assert(value, [message])',
'assert.ok(value, [message])',
'assert.equal(actual, expected, [message])',
'assert.notEqual(actual, expected, [message])',
'assert.strictEqual(actual, expected, [message])',
'assert.notStrictEqual(actual, expected, [message])',
'assert.deepEqual(actual, expected, [message])',
'assert.notDeepEqual(actual, expected, [message])',
'assert.deepStrictEqual(actual, expected, [message])',
'assert.notDeepStrictEqual(actual, expected, [message])',
'assert.fail(actual, expected, message, operator)',
'assert.throws(block, [error], [message])',
'assert.doesNotThrow(block, [message])',
'assert.ifError(value)',
'console.assert(value, [message])'
],
requirePatterns: [
'assert = require("assert")'
],
importPatterns: [
'import assert from "assert"',
'import * as assert from "assert"'
]
}
after:
{
modules: [
'assert',
'assert/strict',
'node:assert',
'node:assert/strict'
]
}
Move power-assert support away from default patterns since power-assert empowers default assert function transparently, so should not be required explicitly. If power-assert is still required explicitly, add 'power-assert' to modules
in customized configuration.
after:
{
modules: [
'assert',
'assert/strict',
'node:assert',
'node:assert/strict',
'power-assert'
]
}
1.6.0 (2019-09-20)
1.5.1 (2017-01-01)
- switch to call-matcher (de4172d)
1.5.0 (2016-12-19)
- Expose
createVisitor
to make assertion and declaration patterns configurable - transfer to unassert-js organization (39164de5)
1.4.1 (2016-07-22)
1.4.0 (2016-05-02)
1.3.1 (2015-12-08)
1.3.0 (2015-10-06)
1.2.1 (2015-09-29)
- remove assignment if and only if operator is
=
(f14bcd3e)
1.2.0 (2015-09-25)
- support removal of assert variable assignment (82cbeea8)
1.1.0 (2015-08-11)
- support removal of CommonJS assert declaration (1c3dc425)
- support removal of CommonJS power-assert declaration (5925b38a)
1.0.0 (2015-05-27)
The first release.