Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(node): Enable native node tests #695

Merged
merged 36 commits into from
Feb 10, 2021
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
feee95d
Move tests folder to _module
Soremwar Feb 2, 2021
4a21149
Fix format
Soremwar Feb 2, 2021
a5e1274
Add test setup
Soremwar Feb 3, 2021
c15be16
Working!
Soremwar Feb 3, 2021
7734aa2
Replace temporal file with Deno.Buffer for decompressing
Soremwar Feb 3, 2021
bc6f872
Remove linting and formatting for the suite
Soremwar Feb 3, 2021
3419e6f
Add runner
Soremwar Feb 3, 2021
28b9a74
Enable std/node/assert
Soremwar Feb 3, 2021
cd0a986
Refactor tests suites generation
Soremwar Feb 3, 2021
efd24cb
Fix runner
Soremwar Feb 3, 2021
b8baf3a
Fmt & Lint
Soremwar Feb 3, 2021
6444609
Enable test suite on CI
Soremwar Feb 3, 2021
589984f
Improve docs
Soremwar Feb 3, 2021
9f69ae5
Add test generation to CI
Soremwar Feb 3, 2021
0f850a4
Rename test folder to "testadata"
Soremwar Feb 3, 2021
68a2c79
Add .gitignore instructions for the test suites
Soremwar Feb 3, 2021
5721ce7
Add docs
Soremwar Feb 3, 2021
5484f9b
Add docs for modules
Soremwar Feb 3, 2021
3fa5213
Add copyright to generated files
Soremwar Feb 3, 2021
4525f75
Fix CI
Soremwar Feb 3, 2021
656843f
It's alivegit add .git add .
Soremwar Feb 3, 2021
fe55858
Fail test suite on failed test
Soremwar Feb 3, 2021
85c6c78
Cleanup comments
Soremwar Feb 3, 2021
c84b451
Define middle ground between not generated and not tested
Soremwar Feb 4, 2021
49e54cc
Convert script test runner to Deno.test
Soremwar Feb 4, 2021
50a74e0
Add docs
Soremwar Feb 4, 2021
4d47be7
Commit tests to std
Soremwar Feb 7, 2021
ff88eec
Adress comments
Soremwar Feb 7, 2021
6f140e3
Fix missing event export
Soremwar Feb 7, 2021
7f68c18
Remove the setup script from executing automatically
Soremwar Feb 7, 2021
32ac255
Use filename as test name
Soremwar Feb 9, 2021
070bfc0
Rename testdata to tools
Soremwar Feb 9, 2021
7962b80
Add comments about automatically generated files
Soremwar Feb 9, 2021
7988ed5
Fmt
Soremwar Feb 9, 2021
c2a9cd3
Rename
Soremwar Feb 9, 2021
13911e2
Accidentally changed process_exit fixture folder
Soremwar Feb 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Move tests folder to _module
  • Loading branch information
Soremwar committed Feb 9, 2021

Unverified

This user has not yet uploaded their public signing key.
commit feee95ddecdaaf6c29af918b010356080c98fc2f
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions node/module_test.ts
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ const require = createRequire(import.meta.url);

Deno.test("requireSuccess", function () {
// Relative to import.meta.url
const result = require("./tests/cjs/cjs_a.js");
const result = require("./_module/cjs/cjs_a.js");
Soremwar marked this conversation as resolved.
Show resolved Hide resolved
assert("helloA" in result);
assert("helloB" in result);
assert("C" in result);
@@ -27,16 +27,16 @@ Deno.test("requireSuccess", function () {
});

Deno.test("requireCycle", function () {
const resultA = require("./tests/cjs/cjs_cycle_a");
const resultB = require("./tests/cjs/cjs_cycle_b");
const resultA = require("./_module/cjs/cjs_cycle_a");
const resultB = require("./_module/cjs/cjs_cycle_b");
assert(resultA);
assert(resultB);
});

Deno.test("requireBuiltin", function () {
const fs = require("fs");
assert("readFileSync" in fs);
const { readFileSync, isNull, extname } = require("./tests/cjs/cjs_builtin");
const { readFileSync, isNull, extname } = require("./_module/cjs/cjs_builtin");

const testData = path.relative(
Deno.cwd(),
@@ -51,7 +51,7 @@ Deno.test("requireBuiltin", function () {
});

Deno.test("requireIndexJS", function () {
const { isIndex } = require("./tests/cjs");
const { isIndex } = require("./_module/cjs");
assert(isIndex);
});

@@ -62,15 +62,15 @@ Deno.test("requireNodeOs", function () {
});

Deno.test("requireStack", function () {
const { hello } = require("./tests/cjs/cjs_throw");
const { hello } = require("./_module/cjs/cjs_throw");
try {
hello();
} catch (e) {
assertStringIncludes(e.stack, "/tests/cjs/cjs_throw.js");
assertStringIncludes(e.stack, "/_module/cjs/cjs_throw.js");
}
});

Deno.test("requireFileInSymlinkDir", () => {
const { C } = require("./tests/cjs/dir");
const { C } = require("./_module/cjs/dir");
assertEquals(C, "C");
});