Skip to content

Commit

Permalink
tests work! clean them up now, please don't break
Browse files Browse the repository at this point in the history
  • Loading branch information
jhmaster2000 committed Mar 29, 2022
1 parent 4572135 commit 1723c56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"build-tsc": "tsc",
"build-configSchema": "typescript-json-schema --topRef --refs --validationKeywords allOf --out tsconfig.schema.json tsconfig.build-schema.json TsConfigSchema && node --require ./register ./scripts/create-merged-schema",
"build-pack": "node ./scripts/build-pack.js",
"test-spec": "ava --node-arguments=\"--no-deprecation --no-warnings\"",
"test-cov": "nyc ava --node-arguments=\"--no-deprecation --no-warnings\"",
"test-spec": "ava --node-arguments=--no-deprecation",
"test-cov": "nyc ava --node-arguments=--no-deprecation",
"test": "npm run build && npm run lint && npm run test-cov --",
"test-local": "npm run lint-fix && npm run build-tsc && npm run build-pack && npm run test-spec --",
"pre-debug": "npm run build-tsc && npm run build-pack",
Expand Down
17 changes: 7 additions & 10 deletions src/test/esm-loader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,10 @@ test.suite('esm', (test) => {
const { err, stdout, stderr } = await cb();
expect(err).toBe(null);
expect(stdout.trim()).toBe('CLI args: foo bar');
if (stderr) {
// Nightly builds of Node.js might randomly start spitting out warnings,
// which would cause the tests to fail despite actually working, so we
// should check if stderr is a warning and consider it a pass if it is.
expect(stderr).toContain('Warning:');
} else {
//expect(stderr).toBe('');
}
// Nightly builds of Node.js might randomly start printing warnings,
// which would cause this test to fail despite actually working,
// so we should ignore stderr when testing on Node.js nightly.
if (!process.version.includes('nightly')) expect(stderr).toBe('');
});
}

Expand All @@ -372,7 +368,6 @@ test.suite('esm', (test) => {
const childP = spawn([
// exec lets us run the shims on windows; spawn does not
process.execPath,
'--no-warnings',
BIN_PATH_JS,
`./esm-child-process/via-tsconfig/sleep.ts`,
]);
Expand Down Expand Up @@ -407,7 +402,9 @@ test.suite('esm', (test) => {
`child registered signal handlers\nchild received signal: ${signal}\nchild exiting`
);
}
t.log(process.version);
// Nightly builds of Node.js might randomly start printing warnings,
// which would cause this test to fail despite actually working,
// so we should ignore stderr when testing on Node.js nightly.
if (!process.version.includes('nightly')) expect(stderr).toBe('');
});
}
Expand Down

0 comments on commit 1723c56

Please sign in to comment.