Tags: unassert-js/unassert
Tags
Variable Tracking, Restructured codebase, CJS/ESM dual package (2022-… …08-01) * [feat] Variable Tracking * remove assertion calls based on their imported variable names * [feat] Restructured codebase * Migrate codebase to ESM and provide CJS/ESM dual package * Replace default exported `unassert` with named exported `unassertAst` * [perf] 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 * [feat] Newly supported syntaxes and features * Support strict assertion mode newly exposed as 'node:assert/strict' * Support destructured assignment of strict property * Support safe removal of loop invariants in for-of statement * Support removal of async assertion such as `assert.rejects` * [fix] unassert causes SyntaxError when body of LabeledStatement is single ExpressionStatement * [BC] This release contains three breaking changes. 1. Replace default exported `unassert` with named exported `unassertAst`. Please use `unassert.unassertAst` instead. before: `const unassert = require('unassert');` after: `const { unassertAst } = require('unassert');` 2. Drop power-assert support from default patterns since power-assert works transparently. If power-assert is still required explicitly, add 'power-assert' to `modules` in customized configuration. 3. 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' ] } ```
2019-09-20 * [chore] Dependency cleanup and updates (by @goto-bus-stop)
PreviousNext