GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: ensure never settling promises are detected · nodejs/node@6c59114

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test
    • .eslintrc.yaml
    • es-module
      • test-esm-cjs-named-error.mjs
    • internet
      • test-dns-lookup.js
    • parallel
      • test-blob.js
      • test-crypto-webcrypto-aes-decrypt-tag-too-small.js
      • test-directory-import.js
      • test-dns-lookup.js
      • test-dns-lookupService-promises.js
      • test-dns-lookupService.js
      • test-dns-resolve-promises.js
      • test-event-emitter-error-monitor.js
      • test-file-validate-mode-flag.js
      • test-filehandle-close.js
      • test-fs-filehandle-use-after-close.js
      • test-fs-lchmod.js
      • test-fs-open.js
      • test-fs-promises-readfile.js
      • test-fs-promises-watch.js
      • test-fs-promises.js
      • test-fs-read-empty-buffer.js
      • test-stream-consumers.js
      • test-stream-readable-destroy.js
      • test-stream-reduce.js
      • test-vm-module-cached-data.js
      • test-vm-timeout-escape-promise-module.js
      • test-webcrypto-export-import-cfrg.js
      • test-webcrypto-export-import-rsa.js
      • test-webstream-readablestream-pipeto.js
      • test-whatwg-readablebytestream.js
      • test-whatwg-readablestream.js
      • test-whatwg-webstreams-adapters-to-readablestream.js
      • test-whatwg-webstreams-adapters-to-readablewritablepair.js
      • test-whatwg-webstreams-adapters-to-streamreadable.js
      • test-whatwg-webstreams-adapters-to-streamwritable.js
      • test-whatwg-webstreams-adapters-to-writablestream.js
      • test-whatwg-webstreams-transfer.js
      • test-whatwg-writablestream.js
      • test-worker-message-port-transfer-filehandle.js
    • sequential
      • test-vm-timeout-escape-promise-module-2.js
    • wasi
      • test-wasi-not-started.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/.eslintrc.yaml‎

Copy file name to clipboardExpand all lines: test/.eslintrc.yaml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ rules:
4949
message: Use 'test' as debuglog value in tests.
5050
- selector: CallExpression:matches([callee.object.name="common"][callee.property.name=/^must(Not)?Call/],[callee.name="mustCall"],[callee.name="mustCallAtLeast"],[callee.name="mustNotCall"])>:first-child[type=/FunctionExpression$/][body.body.length=0]
5151
message: Do not use an empty function, omit the parameter altogether.
52+
- selector: ExpressionStatement>CallExpression:matches([callee.name='rejects'], [callee.object.name='assert'][callee.property.name='rejects'])
53+
message: Calling `assert.rejects` without `await` or `.then(common.mustCall())` will not detect never-settling promises.
5254
- selector: Identifier[name='webcrypto']
5355
message: Use `globalThis.crypto`.
5456

Collapse file

‎test/es-module/test-esm-cjs-named-error.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-cjs-named-error.mjs
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,55 +23,55 @@ const expectedPackageHack =
2323

2424
const expectedBare = errTemplate('deep-fail', 'comeOn', '{ comeOn }');
2525

26-
rejects(async () => {
26+
await rejects(async () => {
2727
await import(`${fixtureBase}/single-quote.mjs`);
2828
}, {
2929
name: 'SyntaxError',
3030
message: expectedRelative
3131
}, 'should support relative specifiers with single quotes');
3232

33-
rejects(async () => {
33+
await rejects(async () => {
3434
await import(`${fixtureBase}/double-quote.mjs`);
3535
}, {
3636
name: 'SyntaxError',
3737
message: expectedRelative
3838
}, 'should support relative specifiers with double quotes');
3939

40-
rejects(async () => {
40+
await rejects(async () => {
4141
await import(`${fixtureBase}/renamed-import.mjs`);
4242
}, {
4343
name: 'SyntaxError',
4444
message: expectedRenamed
4545
}, 'should correctly format named imports with renames');
4646

47-
rejects(async () => {
47+
await rejects(async () => {
4848
await import(`${fixtureBase}/multi-line.mjs`);
4949
}, {
5050
name: 'SyntaxError',
5151
message: expectedWithoutExample,
5252
}, 'should correctly format named imports across multiple lines');
5353

54-
rejects(async () => {
54+
await rejects(async () => {
5555
await import(`${fixtureBase}/json-hack.mjs`);
5656
}, {
5757
name: 'SyntaxError',
5858
message: expectedPackageHack
5959
}, 'should respect recursive package.json for module type');
6060

61-
rejects(async () => {
61+
await rejects(async () => {
6262
await import(`${fixtureBase}/bare-import-single.mjs`);
6363
}, {
6464
name: 'SyntaxError',
6565
message: expectedBare
6666
}, 'should support bare specifiers with single quotes');
6767

68-
rejects(async () => {
68+
await rejects(async () => {
6969
await import(`${fixtureBase}/bare-import-double.mjs`);
7070
}, {
7171
name: 'SyntaxError',
7272
message: expectedBare
7373
}, 'should support bare specifiers with double quotes');
7474

75-
rejects(async () => {
75+
await rejects(async () => {
7676
await import(`${fixtureBase}/escaped-single-quote.mjs`);
7777
}, /import pkg from '\.\/oh'no\.cjs'/, 'should support relative specifiers with escaped single quote');
Collapse file

‎test/internet/test-dns-lookup.js‎

Copy file name to clipboardExpand all lines: test/internet/test-dns-lookup.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ assert.rejects(
1717
code: 'ENOTFOUND',
1818
message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`,
1919
},
20-
);
20+
).then(common.mustCall());
2121

2222
assert.rejects(
2323
dnsPromises.lookup(addresses.NOT_FOUND, {
@@ -29,7 +29,7 @@ assert.rejects(
2929
code: 'ENOTFOUND',
3030
message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`,
3131
},
32-
);
32+
).then(common.mustCall());
3333

3434
dns.lookup(addresses.NOT_FOUND, {
3535
hints: 0,
Collapse file

‎test/parallel/test-blob.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-blob.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,10 @@ assert.throws(() => new Blob({}), {
409409
}
410410

411411
(async () => {
412-
assert.rejects(async () => Blob.prototype.arrayBuffer.call(), {
412+
await assert.rejects(async () => Blob.prototype.arrayBuffer.call(), {
413413
code: 'ERR_INVALID_THIS',
414414
});
415-
assert.rejects(async () => Blob.prototype.text.call(), {
415+
await assert.rejects(async () => Blob.prototype.text.call(), {
416416
code: 'ERR_INVALID_THIS',
417417
});
418418
})().then(common.mustCall());
Collapse file

‎test/parallel/test-crypto-webcrypto-aes-decrypt-tag-too-small.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-crypto-webcrypto-aes-decrypt-tag-too-small.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ subtle.importKey(
1616
},
1717
false,
1818
[ 'encrypt', 'decrypt' ])
19-
.then((k) => {
19+
.then((k) =>
2020
assert.rejects(() => {
2121
return subtle.decrypt({
2222
name: 'AES-GCM',
@@ -25,5 +25,5 @@ subtle.importKey(
2525
}, {
2626
name: 'OperationError',
2727
message: /The provided data is too small/,
28-
});
29-
});
28+
})
29+
).then(common.mustCall());
Collapse file

‎test/parallel/test-directory-import.js‎

Copy file name to clipboard
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
'use strict';
22

3-
require('../common');
3+
const common = require('../common');
44
const fixtures = require('../common/fixtures');
55
const assert = require('assert');
66
const { pathToFileURL } = require('url');
77

88
{
9-
assert.rejects(import('./'), /ERR_UNSUPPORTED_DIR_IMPORT/);
9+
assert.rejects(import('./'), /ERR_UNSUPPORTED_DIR_IMPORT/).then(common.mustCall());
1010
assert.rejects(
1111
import(pathToFileURL(fixtures.path('packages', 'main'))),
1212
/Did you mean/,
13-
);
13+
).then(common.mustCall());
1414
}
Collapse file

‎test/parallel/test-dns-lookup.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-dns-lookup.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,4 @@ tickValue = 1;
205205

206206
// Should fail due to stub.
207207
assert.rejects(dnsPromises.lookup('example.com'),
208-
{ code: 'ENOMEM', hostname: 'example.com' });
208+
{ code: 'ENOMEM', hostname: 'example.com' }).then(common.mustCall());
Collapse file

‎test/parallel/test-dns-lookupService-promises.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-dns-lookupService-promises.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ dnsPromises.lookupService('127.0.0.1', 22).then(common.mustCall((result) => {
1616
assert.rejects(
1717
() => dnsPromises.lookupService('192.0.2.1', 22),
1818
{ code: /^(?:ENOTFOUND|EAI_AGAIN)$/ }
19-
);
19+
).then(common.mustCall());
Collapse file

‎test/parallel/test-dns-lookupService.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-dns-lookupService.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ assert.rejects(
3232
message: 'getnameinfo ENOENT 127.0.0.1',
3333
syscall: 'getnameinfo'
3434
}
35-
);
35+
).then(common.mustCall());
Collapse file

‎test/parallel/test-dns-resolve-promises.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-dns-resolve-promises.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Flags: --expose-internals
22
'use strict';
3-
require('../common');
3+
const common = require('../common');
44
const assert = require('assert');
55
const { internalBinding } = require('internal/test/binding');
66
const cares = internalBinding('cares_wrap');
@@ -17,4 +17,4 @@ assert.rejects(
1717
syscall: 'queryA',
1818
hostname: 'example.org'
1919
}
20-
);
20+
).then(common.mustCall());

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.