Skip to content

Commit

Permalink
test: fixture path sans slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Aug 16, 2024
1 parent 22e9ade commit 6f12266
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/400.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Server from '../lib/main.js';

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

const FIXTURE_PKG = path.resolve(__dirname, '../fixtures/archive.tgz');
const FIXTURE_PKG = path.resolve(__dirname, '..', 'fixtures', 'archive.tgz');

tap.test('400 - GET request with non-existing hostname', async (t) => {
const sink = new Sink();
Expand Down
14 changes: 12 additions & 2 deletions test/alias.map.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,18 @@ import Server from '../lib/main.js';

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

const FIXTURE_MAP = path.resolve(__dirname, '../fixtures/import-map.json');
const FIXTURE_MAP_B = path.resolve(__dirname, '../fixtures/import-map-b.json');
const FIXTURE_MAP = path.resolve(
__dirname,
'..',
'fixtures',
'import-map.json',
);
const FIXTURE_MAP_B = path.resolve(
__dirname,
'..',
'fixtures',
'import-map-b.json',
);

tap.beforeEach(async (t) => {
const sink = new Sink();
Expand Down
2 changes: 1 addition & 1 deletion test/alias.npm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Server from '../lib/main.js';

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

const FIXTURE_PKG = path.resolve(__dirname, '../fixtures/archive.tgz');
const FIXTURE_PKG = path.resolve(__dirname, '..', 'fixtures', 'archive.tgz');

// Ignore the timestamp for "created" field in the snapshots
tap.cleanSnapshot = (s) => {
Expand Down
2 changes: 1 addition & 1 deletion test/alias.pkg.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Server from '../lib/main.js';

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

const FIXTURE_PKG = path.resolve(__dirname, '../fixtures/archive.tgz');
const FIXTURE_PKG = path.resolve(__dirname, '..', 'fixtures', 'archive.tgz');

// Ignore the timestamp for "created" field in the snapshots
tap.cleanSnapshot = (s) => {
Expand Down
9 changes: 7 additions & 2 deletions test/http.cache.control.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ import Server from '../lib/main.js';

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

const FIXTURE_PKG = path.resolve(__dirname, '../fixtures/archive.tgz');
const FIXTURE_MAP = path.resolve(__dirname, '../fixtures/import-map.json');
const FIXTURE_PKG = path.resolve(__dirname, '..', 'fixtures', 'archive.tgz');
const FIXTURE_MAP = path.resolve(
__dirname,
'..',
'fixtures',
'import-map.json',
);

// Ignore the timestamp for "created" field in the snapshots
tap.cleanSnapshot = (s) => {
Expand Down
2 changes: 1 addition & 1 deletion test/http.override.cache.control.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Server from '../lib/main.js';

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

const FIXTURE_PKG = path.resolve(__dirname, '../fixtures/archive.tgz');
const FIXTURE_PKG = path.resolve(__dirname, '..', 'fixtures', 'archive.tgz');

// Ignore the timestamp for "created" field in the snapshots
tap.cleanSnapshot = (s) => {
Expand Down
9 changes: 7 additions & 2 deletions test/http.query.params.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ import Server from '../lib/main.js';

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

const FIXTURE_PKG = path.resolve(__dirname, '../fixtures/archive.tgz');
const FIXTURE_MAP = path.resolve(__dirname, '../fixtures/import-map.json');
const FIXTURE_PKG = path.resolve(__dirname, '..', 'fixtures', 'archive.tgz');
const FIXTURE_MAP = path.resolve(
__dirname,
'..',
'fixtures',
'import-map.json',
);

// Ignore the timestamp for "created" field in the snapshots
tap.cleanSnapshot = (s) => {
Expand Down

0 comments on commit 6f12266

Please sign in to comment.