Skip to content

Commit c2fba9f

Browse files
authored
chore: add integration test for yarn + napi (#591)
1 parent 8eba8c0 commit c2fba9f

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@ jobs:
4141
with:
4242
save-cache: ${{ github.ref_name == 'main' }}
4343
cache-key: warm
44+
tools: just
4445
- uses: ./.github/actions/pnpm
4546
- run: cargo check --all-features --locked
46-
- run: cargo test --doc
47-
- run: cargo test # without features
48-
- run: cargo test --all-features
49-
- run: pnpm run build:debug && pnpm run test
47+
- run: just test
5048
if: ${{ matrix.os != 'windows-latest' }}
5149

5250
lint:

fixtures/pnp/index.test.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import {test} from 'node:test'
2+
import assert from 'node:assert'
3+
import pnpapi from 'pnpapi';
4+
5+
import {ResolverFactory} from '../../napi/index.js'
6+
7+
test('resolver', (_) => {
8+
const resolver = new ResolverFactory();
9+
const directory = import.meta.dirname;
10+
const resolution = resolver.sync(directory, 'is-even');
11+
assert.strictEqual(resolution.path, pnpapi.resolveRequest('is-even', directory));
12+
});

fixtures/pnp/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "pnp",
33
"packageManager": "[email protected]",
4+
"scripts": {
5+
"test": "yarn node index.test.mjs"
6+
},
47
"dependencies": {
58
"@atlaskit/pragmatic-drag-and-drop": "^1.5.2",
69
"@custom/pragmatic-drag-and-drop": "npm:@atlaskit/pragmatic-drag-and-drop@^1.5.2",

justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ test:
5858
cargo test --all-features
5959
node --run build
6060
node --run test
61+
cd fixtures/pnp && yarn test
6162

6263
# Lint the whole project
6364
lint:

0 commit comments

Comments
 (0)