| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ce91bb2 commit 324c82b
13 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,10 +1,10 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - require('../common'); | ||
| 2 | + var common = require('../common'); | ||
| 3 | 3 | var assert = require('assert'); | |
| 4 | 4 | var path = require('path'); | |
| 5 | 5 | ||
| 6 | 6 | var spawn = require('child_process').spawn; | |
| 7 | - var childPath = path.join(__dirname, '..', 'fixtures', | ||
| 7 | + var childPath = path.join(common.fixturesDir, | ||
| 8 | 8 | 'parent-process-nonpersistent.js'); | |
| 9 | 9 | var persistentPid = -1; | |
| 10 | 10 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,10 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - const common = require('../common'); | ||
| 2 | + var common = require('../common'); | ||
| 3 | + var path = require('path'); | ||
| 3 | 4 | var assert = require('assert'); | |
| 4 | 5 | ||
| 5 | 6 | setTimeout(common.mustCall(function() { | |
| 6 | - const a = require('../fixtures/a'); | ||
| 7 | + const a = require(path.join(common.fixturesDir, 'a')); | ||
| 7 | 8 | assert.strictEqual(true, 'A' in a); | |
| 8 | 9 | assert.strictEqual('A', a.A()); | |
| 9 | 10 | assert.strictEqual('D', a.D()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,6 @@ | |||
| 1 | 1 | /* eslint-disable strict */ | |
| 2 | 2 | var common = require('../common'); | |
| 3 | + var path = require('path'); | ||
| 3 | 4 | var assert = require('assert'); | |
| 4 | 5 | ||
| 5 | 6 | common.globalCheck = false; | |
@@ -13,7 +14,7 @@ assert.equal('bar', | |||
| 13 | 14 | baseBar, // eslint-disable-line no-undef | |
| 14 | 15 | 'global.x -> x in base level not working'); | |
| 15 | 16 | ||
| 16 | - var module = require('../fixtures/global/plain'); | ||
| 17 | + var module = require(path.join(common.fixturesDir, 'global', 'plain')); | ||
| 17 | 18 | const fooBar = module.fooBar; | |
| 18 | 19 | ||
| 19 | 20 | assert.equal('foo', fooBar.foo, 'x -> global.x in sub level not working'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ const assert = require('assert'); | |||
| 5 | 5 | const hostExpect = 'localhost'; | |
| 6 | 6 | const fs = require('fs'); | |
| 7 | 7 | const path = require('path'); | |
| 8 | - const fixtures = path.resolve(__dirname, '../fixtures/keys'); | ||
| 8 | + const fixtures = path.join(common.fixturesDir, 'keys'); | ||
| 9 | 9 | const options = { | |
| 10 | 10 | key: fs.readFileSync(fixtures + '/agent1-key.pem'), | |
| 11 | 11 | cert: fs.readFileSync(fixtures + '/agent1-cert.pem') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,10 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - require('../common'); | ||
| 2 | + var common = require('../common'); | ||
| 3 | + var path = require('path'); | ||
| 3 | 4 | var assert = require('assert'); | |
| 4 | 5 | ||
| 5 | 6 | assert.throws(function() { | |
| 6 | 7 | require('internal/freelist'); | |
| 7 | 8 | }); | |
| 8 | 9 | ||
| 9 | - assert(require('../fixtures/internal-modules') === 42); | ||
| 10 | + assert(require(path.join(common.fixturesDir, 'internal-modules')) === 42); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - require('../common'); | ||
| 2 | + const common = require('../common'); | ||
| 3 | 3 | const assert = require('assert'); | |
| 4 | 4 | const path = require('path'); | |
| 5 | 5 | const child_process = require('child_process'); | |
@@ -15,7 +15,7 @@ var preloadOption = function(preloads) { | |||
| 15 | 15 | }; | |
| 16 | 16 | ||
| 17 | 17 | var fixture = function(name) { | |
| 18 | - return path.join(__dirname, '../fixtures/' + name); | ||
| 18 | + return path.join(common.fixturesDir, name); | ||
| 19 | 19 | }; | |
| 20 | 20 | ||
| 21 | 21 | var fixtureA = fixture('printA.js'); | |
@@ -82,7 +82,7 @@ child_process.exec(nodeBinary + ' ' | |||
| 82 | 82 | }); | |
| 83 | 83 | ||
| 84 | 84 | // https://github.com/nodejs/node/issues/1691 | |
| 85 | - process.chdir(path.join(__dirname, '../fixtures/')); | ||
| 85 | + process.chdir(common.fixturesDir); | ||
| 86 | 86 | child_process.exec(nodeBinary + ' ' | |
| 87 | 87 | + '--expose_debug_as=v8debug ' | |
| 88 | 88 | + '--require ' + fixture('cluster-preload.js') + ' ' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,7 +68,7 @@ const sameHistoryFilePaths = '\nThe old repl history file has the same name ' + | |||
| 68 | 68 | path.join(common.tmpDir, '.node_repl_history') + | |
| 69 | 69 | ' and is empty.\nUsing it as is.\n'; | |
| 70 | 70 | // File paths | |
| 71 | - const fixtures = path.join(common.testDir, 'fixtures'); | ||
| 71 | + const fixtures = common.fixturesDir; | ||
| 72 | 72 | const historyFixturePath = path.join(fixtures, '.node_repl_history'); | |
| 73 | 73 | const historyPath = path.join(common.tmpDir, '.fixture_copy_repl_history'); | |
| 74 | 74 | const historyPathFail = path.join(common.tmpDir, '.node_repl\u0000_history'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,7 @@ common.ArrayStream.prototype.write = function(output) { | |||
| 17 | 17 | ||
| 18 | 18 | const putIn = new common.ArrayStream(); | |
| 19 | 19 | repl.start('', putIn); | |
| 20 | - let file = path.resolve(__dirname, '../fixtures/syntax/bad_syntax'); | ||
| 20 | + let file = path.join(common.fixturesDir, 'syntax', 'bad_syntax'); | ||
| 21 | 21 | ||
| 22 | 22 | if (common.isWindows) | |
| 23 | 23 | file = file.replace(/\\/g, '\\\\'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,10 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - require('../common'); | ||
| 2 | + var common = require('../common'); | ||
| 3 | + var path = require('path'); | ||
| 3 | 4 | var assert = require('assert'); | |
| 4 | 5 | ||
| 5 | 6 | try { | |
| 6 | - require('../fixtures/invalid.json'); | ||
| 7 | + require(path.join(common.fixturesDir, 'invalid.json')); | ||
| 7 | 8 | } catch (err) { | |
| 8 | 9 | var re = /test[\/\\]fixtures[\/\\]invalid.json: Unexpected string/; | |
| 9 | 10 | var i = err.message.match(re); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,9 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - require('../common'); | ||
| 2 | + var common = require('../common'); | ||
| 3 | 3 | var assert = require('assert'); | |
| 4 | 4 | var path = require('path'); | |
| 5 | 5 | var fs = require('fs'); | |
| 6 | 6 | ||
| 7 | - var fixture = path.join(__dirname, '../fixtures/x.txt'); | ||
| 7 | + var fixture = path.join(common.fixturesDir, 'x.txt'); | ||
| 8 | 8 | ||
| 9 | 9 | assert.equal('xyz\n', fs.readFileSync(fixture)); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments