Skip to content

Commit

Permalink
Remove dependency on power-assert
Browse files Browse the repository at this point in the history
To not scare users with core-js deprecation warnings.

Closes #4
  • Loading branch information
jirutka committed May 21, 2023
1 parent 34c1263 commit 58f8820
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
5 changes: 0 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
:ESLint: link:https://eslint.org[ESLint]
:Mocha: link:https://mochajs.org[Mocha]
:nginx-testing: link:https://github.com/jirutka/nginx-testing[nginx-testing]
:power-assert: link:https://github.com/power-assert-js/power-assert[power-assert]
:Rollup: link:https://babeljs.io[Rollup]
:yarn: link:https://yarnpkg.com/[yarn]
:npm: link:https://docs.npmjs.com/cli/commands/npm/[npm]
Expand Down Expand Up @@ -194,10 +193,6 @@ The following is a list of `devDependencies` with their description.
* {npmjs-pkg}/mocha[mocha] -- A flexible JavaScript test framework for Node.js.
** {npmjs-pkg}/mocha-suite-hooks[mocha-suite-hooks] -- Suite-level hooks for {Mocha}; allows to run hook before/after describe block.

* {npmjs-pkg}/power-assert[power-assert] -- “Power Assert” in JavaScript. Provides descriptive assertion messages through standard assert interface.
** {npmjs-pkg}/babel-plugin-empower-assert[babel-plugin-empower-assert] -- A {Babel} plugin to convert https://nodejs.org/api/assert.html[assert] to {power-assert} at compile time.
** {npmjs-pkg}/babel-plugin-espower[babel-plugin-espower] -- A {Babel} plugin for {power-assert}.

* {npmjs-pkg}/nginx-testing[nginx-testing] -- Support for integration/acceptance testing of nginx configuration.

* {npmjs-pkg}/got[got] -- A human-friendly and powerful HTTP request library for Node.js. Used in integration tests. Do _not_ update it to version 12.x (see https://github.com/{gh-name}/issues/3[#3])!
Expand Down
5 changes: 0 additions & 5 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,5 @@ module.exports = (api) => ({
// This is not used with Rollup.
'@babel/plugin-transform-modules-commonjs'
] : [],
...api.env('mocha') ? [
// Transform power-assert. This is used only for Mocha tests.
'babel-plugin-empower-assert',
'babel-plugin-espower',
] : [],
],
})
6 changes: 3 additions & 3 deletions integration-tests/hello.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { strict as assert } from 'assert'
import assert from 'assert/strict'
import { test } from 'mocha'
import './hooks'


test('/hello?name=njs', async function () {
const resp = await this.client.get('hello?name=njs')

assert(resp.statusCode === 200)
assert(resp.body.includes('Meow, njs!'))
assert.equal(resp.statusCode, 200)
assert.match(resp.body, /Meow, njs!/)
})
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
"@types/rollup-plugin-add-git-msg": "^1.1.1",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"babel-plugin-empower-assert": "^2.0.0",
"babel-plugin-espower": "^3.0.1",
"babel-preset-njs": "^0.7.0",
"babel-register-ts": "^7.0.0",
"eslint": "^8.40.0",
Expand All @@ -54,7 +52,6 @@
"nginx-testing": "^0.4.0",
"njs-types": "^0.7.12",
"npm-run-all": "^4.1.5",
"power-assert": "^1.6.1",
"rimraf": "^5.0.1",
"rollup": "^3.22.0",
"rollup-plugin-add-git-msg": "^1.1.0",
Expand Down

0 comments on commit 58f8820

Please sign in to comment.