Skip to content

Commit

Permalink
chore: improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
g-chao committed Mar 27, 2024
1 parent c19eaa5 commit 3aa51db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pnpm-sync-api-demo/src/test/pnpmSyncPrepare.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { FileSystem } from '@rushstack/node-core-library';
import { readWantedLockfile, Lockfile } from '@pnpm/lockfile-file';

describe('Example Test', () => {
describe('pnpm-sync-api test', () => {
it('pnpmSyncPrepareAsync should generate .pnpm-sync.json under pnpm-sync-cli-demo/lib1/node_modules', async () => {
const lockfilePath = '../pnpm-lock.yaml';
const dotPnpmFolder = '../node_modules/.pnpm';
Expand All @@ -20,6 +20,8 @@ describe('Example Test', () => {
fs.unlinkSync(expectedDotPnpmSyncJsonPath);
}

expect(fs.existsSync(expectedDotPnpmSyncJsonPath)).toBe(false);

await pnpmSyncPrepareAsync({
lockfilePath: lockfilePath,
dotPnpmFolder: dotPnpmFolder,
Expand Down Expand Up @@ -55,6 +57,9 @@ describe('Example Test', () => {
});

// now, read .pnpm-sync.json and check the fields

expect(fs.existsSync(expectedDotPnpmSyncJsonPath)).toBe(true);

const pnpmSyncJsonFile: {
postbuildInjectedCopy: {
sourceFolder: string;
Expand Down

0 comments on commit 3aa51db

Please sign in to comment.