GeezerVison is showing github.com — test: use `tmpdir.resolve()` · nodejs/node@6595367
File treeExpand file treeCollapse file tree Open diff view settings Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-blob-file-backed.js +3-4Lines changed: 3 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -15,13 +15,12 @@ const { | 15 | 15 | const { | 16 | 16 | unlink | 17 | 17 | } = require('fs/promises'); | 18 | | -const path = require('path'); | 19 | 18 | const { Blob } = require('buffer'); | 20 | 19 |
| 21 | 20 | const tmpdir = require('../common/tmpdir'); | 22 | | -const testfile = path.join(tmpdir.path, 'test-file-backed-blob.txt'); | 23 | | -const testfile2 = path.join(tmpdir.path, 'test-file-backed-blob2.txt'); | 24 | | -const testfile3 = path.join(tmpdir.path, 'test-file-backed-blob3.txt'); | | 21 | +const testfile = tmpdir.resolve('test-file-backed-blob.txt'); | | 22 | +const testfile2 = tmpdir.resolve('test-file-backed-blob2.txt'); | | 23 | +const testfile3 = tmpdir.resolve('test-file-backed-blob3.txt'); | 25 | 24 | tmpdir.refresh(); | 26 | 25 |
| 27 | 26 | const data = `${'a'.repeat(1000)}${'b'.repeat(2000)}`; | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-child-process-fork-exec-path.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,13 +27,12 @@ const common = require('../common'); | 27 | 27 | const tmpdir = require('../common/tmpdir'); | 28 | 28 | const { addLibraryPath } = require('../common/shared-lib-util'); | 29 | 29 | const assert = require('assert'); | 30 | | -const path = require('path'); | 31 | 30 | const fs = require('fs'); | 32 | 31 | const { fork } = require('child_process'); | 33 | 32 |
| 34 | 33 | const msg = { test: 'this' }; | 35 | 34 | const nodePath = process.execPath; | 36 | | -const copyPath = path.join(tmpdir.path, 'node-copy.exe'); | | 35 | +const copyPath = tmpdir.resolve('node-copy.exe'); | 37 | 36 |
| 38 | 37 | addLibraryPath(process.env); | 39 | 38 |
| |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-child-process-pipe-dataflow.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | 'use strict'; | 2 | 2 | const common = require('../common'); | 3 | 3 | const assert = require('assert'); | 4 | | -const path = require('path'); | 5 | 4 | const fs = require('fs'); | 6 | 5 | const spawn = require('child_process').spawn; | 7 | 6 | const tmpdir = require('../common/tmpdir'); | @@ -18,7 +17,7 @@ const MB = KB * KB; | 18 | 17 |
| 19 | 18 | { | 20 | 19 | tmpdir.refresh(); | 21 | | - const file = path.resolve(tmpdir.path, 'data.txt'); | | 20 | + const file = tmpdir.resolve('data.txt'); | 22 | 21 | const buf = Buffer.alloc(MB).fill('x'); | 23 | 22 |
| 24 | 23 | // Most OS commands that deal with data, attach special meanings to new line - | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-crypto-authenticated-stream.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,6 @@ if (!common.hasCrypto) | 7 | 7 | const assert = require('assert'); | 8 | 8 | const crypto = require('crypto'); | 9 | 9 | const fs = require('fs'); | 10 | | -const path = require('path'); | 11 | 10 | const stream = require('stream'); | 12 | 11 | const tmpdir = require('../common/tmpdir'); | 13 | 12 |
| @@ -72,7 +71,7 @@ function mstream(config) { | 72 | 71 |
| 73 | 72 | function fstream(config) { | 74 | 73 | const count = fstream.count++; | 75 | | - const filename = (name) => path.join(tmpdir.path, `${name}${count}`); | | 74 | + const filename = (name) => tmpdir.resolve(`${name}${count}`); | 76 | 75 |
| 77 | 76 | const { cipher, key, iv, aad, authTagLength, plaintextLength } = config; | 78 | 77 | const expected = Buffer.alloc(plaintextLength); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-crypto-sign-verify.js +2-3Lines changed: 2 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,6 @@ if (!common.hasCrypto) | 5 | 5 |
| 6 | 6 | const assert = require('assert'); | 7 | 7 | const fs = require('fs'); | 8 | | -const path = require('path'); | 9 | 8 | const exec = require('child_process').exec; | 10 | 9 | const crypto = require('crypto'); | 11 | 10 | const fixtures = require('../common/fixtures'); | @@ -617,9 +616,9 @@ assert.throws( | 617 | 616 | const tmpdir = require('../common/tmpdir'); | 618 | 617 | tmpdir.refresh(); | 619 | 618 |
| 620 | | - const sigfile = path.join(tmpdir.path, 's5.sig'); | | 619 | + const sigfile = tmpdir.resolve('s5.sig'); | 621 | 620 | fs.writeFileSync(sigfile, s5); | 622 | | - const msgfile = path.join(tmpdir.path, 's5.msg'); | | 621 | + const msgfile = tmpdir.resolve('s5.msg'); | 623 | 622 | fs.writeFileSync(msgfile, msg); | 624 | 623 |
| 625 | 624 | const cmd = | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-http-agent-getname.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 | require('../common'); | 4 | 4 | const assert = require('assert'); | 5 | 5 | const http = require('http'); | 6 | | -const path = require('path'); | 7 | 6 |
| 8 | 7 | const tmpdir = require('../common/tmpdir'); | 9 | 8 |
| @@ -41,7 +40,7 @@ assert.strictEqual( | 41 | 40 | ); | 42 | 41 |
| 43 | 42 | // unix socket | 44 | | -const socketPath = path.join(tmpdir.path, 'foo', 'bar'); | | 43 | +const socketPath = tmpdir.resolve('foo', 'bar'); | 45 | 44 | assert.strictEqual( | 46 | 45 | agent.getName({ | 47 | 46 | socketPath | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-http-chunk-problem.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -39,7 +39,7 @@ const cp = require('child_process'); | 39 | 39 |
| 40 | 40 | const tmpdir = require('../common/tmpdir'); | 41 | 41 |
| 42 | | -const filename = require('path').join(tmpdir.path, 'big'); | | 42 | +const filename = tmpdir.resolve('big'); | 43 | 43 | let server; | 44 | 44 |
| 45 | 45 | function executeRequest(cb) { | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-http-pipe-fs.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 23 | 23 | const common = require('../common'); | 24 | 24 | const http = require('http'); | 25 | 25 | const fs = require('fs'); | 26 | | -const path = require('path'); | 27 | 26 | const Countdown = require('../common/countdown'); | 28 | 27 | const NUMBER_OF_STREAMS = 2; | 29 | 28 |
| @@ -32,7 +31,7 @@ const countdown = new Countdown(NUMBER_OF_STREAMS, () => server.close()); | 32 | 31 | const tmpdir = require('../common/tmpdir'); | 33 | 32 | tmpdir.refresh(); | 34 | 33 |
| 35 | | -const file = path.join(tmpdir.path, 'http-pipe-fs-test.txt'); | | 34 | +const file = tmpdir.resolve('http-pipe-fs-test.txt'); | 36 | 35 |
| 37 | 36 | const server = http.createServer(common.mustCall(function(req, res) { | 38 | 37 | const stream = fs.createWriteStream(file); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-http2-compat-serverrequest-pipe.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -7,14 +7,13 @@ const fixtures = require('../common/fixtures'); | 7 | 7 | const assert = require('assert'); | 8 | 8 | const http2 = require('http2'); | 9 | 9 | const fs = require('fs'); | 10 | | -const path = require('path'); | 11 | 10 |
| 12 | 11 | // Piping should work as expected with createWriteStream | 13 | 12 |
| 14 | 13 | const tmpdir = require('../common/tmpdir'); | 15 | 14 | tmpdir.refresh(); | 16 | 15 | const loc = fixtures.path('person-large.jpg'); | 17 | | -const fn = path.join(tmpdir.path, 'http2-url-tests.js'); | | 16 | +const fn = tmpdir.resolve('http2-url-tests.js'); | 18 | 17 |
| 19 | 18 | const server = http2.createServer(); | 20 | 19 |
| |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-http2-pipe-named-pipe.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -8,14 +8,13 @@ const assert = require('assert'); | 8 | 8 | const http2 = require('http2'); | 9 | 9 | const fs = require('fs'); | 10 | 10 | const net = require('net'); | 11 | | -const path = require('path'); | 12 | 11 |
| 13 | 12 | // HTTP/2 servers can listen on a named pipe. | 14 | 13 |
| 15 | 14 | const tmpdir = require('../common/tmpdir'); | 16 | 15 | tmpdir.refresh(); | 17 | 16 | const loc = fixtures.path('person-large.jpg'); | 18 | | -const fn = path.join(tmpdir.path, 'person-large.jpg'); | | 17 | +const fn = tmpdir.resolve('person-large.jpg'); | 19 | 18 |
| 20 | 19 | const server = http2.createServer(); | 21 | 20 |
| |
|