Skip to content

Commit

Permalink
fix: import from 'assert' to support node@^14.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fahslaj authored and JamesHenry committed Jul 28, 2022
1 parent 839b271 commit 04c0757
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -43,7 +43,7 @@ index SHA..SHA
+'use strict';
+
+const myCli = require('..');
+const assert = require('node:assert').strict;
+const assert = require('assert').strict;
+
+assert.strictEqual(myCli(), 'Hello from myCli');
+console.info("myCli tests passed");
Expand Down Expand Up @@ -185,7 +185,7 @@ index SHA..SHA
+++ b/packages/my-es-cli/__tests__/my-es-cli.test.js
@@ -0,0 +1,5 @@
+import myEsCli from '../src/my-es-cli.js';
+import { strict as assert } from 'node:assert';
+import { strict as assert } from 'assert';
+
+assert.strictEqual(myEsCli(), 'Hello from myEsCli');
+console.info("myEsCli tests passed");
Expand Down Expand Up @@ -311,7 +311,7 @@ index SHA..SHA
+'use strict';
+
+const myPkg = require('..');
+const assert = require('node:assert').strict;
+const assert = require('assert').strict;
+
+assert.strictEqual(myPkg(), 'Hello from myPkg');
+console.info("myPkg tests passed");
Expand Down Expand Up @@ -388,7 +388,7 @@ index SHA..SHA
+++ b/packages/my-pkg/__tests__/my-pkg.test.js
@@ -0,0 +1,5 @@
+import myPkg from '../src/my-pkg.js';
+import { strict as assert } from 'node:assert';
+import { strict as assert } from 'assert';
+
+assert.strictEqual(myPkg(), 'Hello from myPkg');
+console.info("myPkg tests passed");
Expand Down
4 changes: 2 additions & 2 deletions commands/create/index.js
Expand Up @@ -419,7 +419,7 @@ class CreateCommand extends Command {
const testContent = this.options.esModule
? dedent`
import ${this.camelName} from '../src/${this.dirName}.js';
import { strict as assert } from 'node:assert';
import { strict as assert } from 'assert';
assert.strictEqual(${this.camelName}(), 'Hello from ${this.camelName}');
console.info("${this.camelName} tests passed");
Expand All @@ -428,7 +428,7 @@ class CreateCommand extends Command {
'use strict';
const ${this.camelName} = require('..');
const assert = require('node:assert').strict;
const assert = require('assert').strict;
assert.strictEqual(${this.camelName}(), 'Hello from ${this.camelName}');
console.info("${this.camelName} tests passed");
Expand Down

0 comments on commit 04c0757

Please sign in to comment.