Skip to content

Tags: unassert-js/unassert

Tags

v2.0.2

Toggle v2.0.2's commit message
2023-04-20

  * [fix] Ensure tooling can access package.json

v2.0.1

Toggle v2.0.1's commit message
2023-04-19

  * [fix] fix "exports" for node 13.0-13.6 by @ljharb

v2.0.0

Toggle v2.0.0's commit message
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'
  ]
}
```

v1.6.0

Toggle v1.6.0's commit message
2019-09-20

  * [chore] Dependency cleanup and updates (by @goto-bus-stop)

v1.5.1

Toggle v1.5.1's commit message
2017-01-01

  * [chore] switch to call-matcher

v1.5.0

Toggle v1.5.0's commit message
2016-12-19

  * [feat] expose `createVisitor` to make assertion and declaration patterns configurable
  * [chore] transfer to unassert-js organization

v1.4.1

Toggle v1.4.1's commit message
2016-07-22

  * [fix] Add empty block if parent is non-block statement

v1.4.0

Toggle v1.4.0's commit message
support ImportNamespaceSpecifier (2016-05-02)

  * [feat] support ImportNamespaceSpecifier

v1.3.1

Toggle v1.3.1's commit message
2015-12-08

  * [fix] remove assertion if and only if its parent is an ExpressionStatement

v1.3.0

Toggle v1.3.0's commit message
Support removal of ES6 import declaration (2015-10-06)

  * [feat] support removal of ES6 import declaration