Skip to content

Commit 9fb5b2d

Browse files
authored
fix: packager detect tests are not running (#199)
1 parent 1ad74b0 commit 9fb5b2d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/programmatic/__snapshots__/detect.spec.ts.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ exports[`packager > npm 1`] = `"npm"`;
2020

2121
exports[`packager > pnpm 1`] = `"pnpm"`;
2222

23-
exports[`packager > pnpm@6 1`] = `"pnpm"`;
23+
exports[`packager > pnpm@6 1`] = `"pnpm@6"`;
2424

2525
exports[`packager > unknown 1`] = `null`;
2626

2727
exports[`packager > yarn 1`] = `"yarn"`;
2828

29-
exports[`packager > yarn@berry 1`] = `"yarn"`;
29+
exports[`packager > yarn@berry 1`] = `"yarn@berry"`;

test/programmatic/detect.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import { AGENTS, detect } from '../../src'
77

88
let basicLog: SpyInstance, errorLog: SpyInstance, warnLog: SpyInstance, infoLog: SpyInstance
99

10-
function detectTest(agent: string) {
10+
function detectTest(fixture: string, agent: string) {
1111
return async () => {
1212
const cwd = await fs.mkdtemp(path.join(tmpdir(), 'ni-'))
13-
const fixture = path.join(__dirname, '..', 'fixtures', 'lockfile', agent)
14-
await fs.copy(fixture, cwd)
13+
const dir = path.join(__dirname, '..', 'fixtures', fixture, agent)
14+
await fs.copy(dir, cwd)
1515

1616
expect(await detect({ programmatic: true, cwd })).toMatchSnapshot()
1717
}
@@ -33,7 +33,7 @@ const fixtures = ['lockfile', 'packager']
3333

3434
// matrix testing of: fixtures x agents
3535
fixtures.forEach(fixture => describe(fixture, () => agents.forEach((agent) => {
36-
it(agent, detectTest(agent))
36+
it(agent, detectTest(fixture, agent))
3737

3838
it('no logs', () => {
3939
expect(basicLog).not.toHaveBeenCalled()

0 commit comments

Comments
 (0)