Skip to content

Commit 39f6c29

Browse files
committed
chore: Refactor package manager test fixtures
1 parent 936e89f commit 39f6c29

12 files changed

Lines changed: 18 additions & 18 deletions

File tree

packages/wxt/src/core/package-managers/__tests__/bun.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { describe, expect, it } from 'vitest';
22
import path from 'node:path';
33
import { bun } from '../bun';
44

5-
const cwd = path.resolve(__dirname, 'fixtures/bun-project');
6-
75
describe.skipIf(() => process.platform === 'win32')(
86
'Bun Package Management Utils',
97
() => {
108
describe('listDependencies', () => {
9+
const cwd = path.resolve(__dirname, 'fixtures/simple-bun-project');
10+
1111
it('should list direct dependencies', async () => {
1212
const actual = await bun.listDependencies({ cwd });
1313
expect(actual).toEqual([

packages/wxt/src/core/package-managers/__tests__/fixtures/bun-project/bun.lockb renamed to packages/wxt/src/core/package-managers/__tests__/fixtures/simple-bun-project/bun.lockb

File renamed without changes.

packages/wxt/src/core/package-managers/__tests__/fixtures/bun-project/package.json renamed to packages/wxt/src/core/package-managers/__tests__/fixtures/simple-bun-project/package.json

File renamed without changes.

packages/wxt/src/core/package-managers/__tests__/fixtures/npm-project/package-lock.json renamed to packages/wxt/src/core/package-managers/__tests__/fixtures/simple-npm-project/package-lock.json

File renamed without changes.

packages/wxt/src/core/package-managers/__tests__/fixtures/npm-project/package.json renamed to packages/wxt/src/core/package-managers/__tests__/fixtures/simple-npm-project/package.json

File renamed without changes.

packages/wxt/src/core/package-managers/__tests__/fixtures/pnpm-project/package.json renamed to packages/wxt/src/core/package-managers/__tests__/fixtures/simple-pnpm-project/package.json

File renamed without changes.

packages/wxt/src/core/package-managers/__tests__/fixtures/pnpm-project/pnpm-lock.yaml renamed to packages/wxt/src/core/package-managers/__tests__/fixtures/simple-pnpm-project/pnpm-lock.yaml

File renamed without changes.

packages/wxt/src/core/package-managers/__tests__/fixtures/yarn-project/package.json renamed to packages/wxt/src/core/package-managers/__tests__/fixtures/simple-yarn-project/package.json

File renamed without changes.

packages/wxt/src/core/package-managers/__tests__/fixtures/yarn-project/yarn.lock renamed to packages/wxt/src/core/package-managers/__tests__/fixtures/simple-yarn-project/yarn.lock

File renamed without changes.

packages/wxt/src/core/package-managers/__tests__/npm.test.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ import { npm } from '../npm';
44
import { execaCommand } from 'execa';
55
import { exists } from 'fs-extra';
66

7-
const cwd = path.resolve(__dirname, 'fixtures/npm-project');
8-
97
describe('NPM Package Management Utils', () => {
10-
beforeAll(async () => {
11-
// NPM needs the modules installed for 'npm ls' to work
12-
await execaCommand('npm i', { cwd });
13-
}, 60e3);
14-
158
describe('listDependencies', () => {
9+
const cwd = path.resolve(__dirname, 'fixtures/simple-npm-project');
10+
beforeAll(async () => {
11+
// NPM needs the modules installed for 'npm ls' to work
12+
await execaCommand('npm i', { cwd });
13+
}, 60e3);
14+
1615
it('should list direct dependencies', async () => {
1716
const actual = await npm.listDependencies({ cwd });
1817
expect(actual).toEqual([
@@ -32,6 +31,8 @@ describe('NPM Package Management Utils', () => {
3231
});
3332

3433
describe('downloadDependency', () => {
34+
const cwd = path.resolve(__dirname, 'fixtures/simple-npm-project');
35+
3536
it('should download the dependency as a tarball', async () => {
3637
const downloadDir = path.resolve(cwd, 'dist');
3738
const id = 'mime-db@1.52.0';

0 commit comments

Comments
 (0)