Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ directory, see [the guide on writing tests](../doc/contributing/writing-tests.md
On how to run tests in this directory, see
[the contributing guide](../doc/contributing/pull-requests.md#step-6-test).

For the tests to run on Windows, be sure to clone Node.js source code with the
`autocrlf` git config flag set to true.

## Test Directories

| Directory | Runs on CI | Purpose |
Expand Down
8 changes: 5 additions & 3 deletions test/parallel/test-snapshot-typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ const { spawnSync } = require('child_process');
const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');
const fs = require('fs');
const os = require('os');

tmpdir.refresh();
const blobPath = tmpdir.resolve('snapshot.blob');

// Concat test/fixtures/snapshot/typescript.js with
// test/fixtures/snapshot/typescript.js into
// test/fixtures/snapshot/typescript-main.js into
// tmpdir/snapshot.js.
const file = tmpdir.resolve('snapshot.js');
fs.copyFileSync(fixtures.path('snapshot', 'typescript.js'), file);
Expand Down Expand Up @@ -57,7 +58,8 @@ fs.appendFileSync(file,

assert.strictEqual(child.status, 0);
const result = fs.readFileSync(outPath, 'utf8');
const expected = fs.readFileSync(
fixtures.path('snapshot', 'ts-example.js'), 'utf8');
const expected = fs
.readFileSync(fixtures.path('snapshot', 'ts-example.js'), 'utf8')
.replace(/\r?\n/g, os.EOL);
assert.strictEqual(result, expected);
}