Skip to content

Commit

Permalink
chore: run format
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Mar 3, 2024
1 parent e58facc commit 935b337
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions src/test/main_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,43 @@ test('findPackagePath', async (t) => {
});

await t.test('skips directories named `package.json`', async () => {
const fixturePath = joinPath(currentDir, 'test/fixtures/package-json-dir/package.json');
const fixturePath = joinPath(
currentDir,
'test/fixtures/package-json-dir/package.json'
);
assert.equal(await findPackagePath(fixturePath), rootPackagePath);
});

await t.test('finds package in first dir', async () => {
const fixturePath = joinPath(currentDir, 'test/fixtures/simple-package');
const packagePath = joinPath(currentDir, 'test/fixtures/simple-package/package.json');
const packagePath = joinPath(
currentDir,
'test/fixtures/simple-package/package.json'
);
assert.equal(await findPackagePath(fixturePath), packagePath);
});

await t.test('finds package in parent dir', async () => {
const fixturePath = joinPath(currentDir, 'test/fixtures/simple-package/src');
const packagePath = joinPath(currentDir, 'test/fixtures/simple-package/package.json');
const fixturePath = joinPath(
currentDir,
'test/fixtures/simple-package/src'
);
const packagePath = joinPath(
currentDir,
'test/fixtures/simple-package/package.json'
);
assert.equal(await findPackagePath(fixturePath), packagePath);
});

await t.test('finds package in nested package', async () => {
const fixturePath = joinPath(currentDir, 'test/fixtures/nested-packages/nested-package-a');
const packagePath = joinPath(currentDir, 'test/fixtures/nested-packages/nested-package-a/package.json');
const fixturePath = joinPath(
currentDir,
'test/fixtures/nested-packages/nested-package-a'
);
const packagePath = joinPath(
currentDir,
'test/fixtures/nested-packages/nested-package-a/package.json'
);
assert.equal(await findPackagePath(fixturePath), packagePath);
});
});
Expand Down

0 comments on commit 935b337

Please sign in to comment.