From dba422856b4ef2f52c94007340248bd3129f65d2 Mon Sep 17 00:00:00 2001 From: Reuben Ellis Date: Wed, 22 May 2024 16:56:22 -0600 Subject: [PATCH] update tests for npm and pnpm --- .circleci/config.yml | 1 - .github/workflows/smoke-test-npx.yml | 6 ++---- .github/workflows/smoke-test-pnpm.yml | 25 +++++++++++++++++++++++++ bin-src/trace.test.ts | 3 +-- node-src/tasks/initialize.test.ts | 2 ++ 5 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/smoke-test-pnpm.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index a6619e0ed..a84a41638 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,6 @@ jobs: keys: - v4-dependencies-{{ checksum "yarn.lock" }} - v4-dependencies- - - run: corepack enable - run: yarn set version berry - run: yarn install diff --git a/.github/workflows/smoke-test-npx.yml b/.github/workflows/smoke-test-npx.yml index dde2ace89..590dabfbd 100644 --- a/.github/workflows/smoke-test-npx.yml +++ b/.github/workflows/smoke-test-npx.yml @@ -14,11 +14,9 @@ jobs: - uses: actions/setup-node@v3 with: node-version: lts/* - - run: corepack enable - - run: yarn set version berry - name: install - run: yarn && git status --porcelain - - run: yarn build + run: npm install && git status --porcelain + - run: npm run build - name: run chromatic run: npx -p . chromatic --build-script-name build-test-storybook --exit-zero-on-changes --force-rebuild env: diff --git a/.github/workflows/smoke-test-pnpm.yml b/.github/workflows/smoke-test-pnpm.yml new file mode 100644 index 000000000..4f581d949 --- /dev/null +++ b/.github/workflows/smoke-test-pnpm.yml @@ -0,0 +1,25 @@ +name: Smoke test via pnpm +on: push + +permissions: + contents: read + +jobs: + chromatic: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: lts/* + - name: install + run: pnpm install && git status --porcelain + - run: pnpm build + - name: run chromatic + run: pnpm dlx chromatic --build-script-name build-test-storybook --exit-zero-on-changes --force-rebuild + env: + LOG_LEVEL: debug + DEBUG: chromatic-cli + CHROMATIC_PROJECT_TOKEN: ${{ secrets.SMOKE_TESTS_CHROMATIC_PROJECT_TOKEN }} diff --git a/bin-src/trace.test.ts b/bin-src/trace.test.ts index 496f50b14..d03b4c451 100644 --- a/bin-src/trace.test.ts +++ b/bin-src/trace.test.ts @@ -25,8 +25,7 @@ describe('Test trace script from package.json', () => { // Execute the script as a child process const output = execSync(`yarn ${scriptName}`).toString().trim(); - console.log(output); - + const expandedStoryModule = `node-src/ui/messages/errors/invalidReportPath.stories.ts`; const expandedFileModule = `node-src/ui/messages/errors/invalidReportPath.ts`; diff --git a/node-src/tasks/initialize.test.ts b/node-src/tasks/initialize.test.ts index 6cc4cb26f..bcf442142 100644 --- a/node-src/tasks/initialize.test.ts +++ b/node-src/tasks/initialize.test.ts @@ -47,6 +47,8 @@ describe('setRuntimeMetadata', () => { } as any; await setRuntimeMetadata(ctx); + console.log(ctx.runtimeMetadata); + expect(ctx.runtimeMetadata).toEqual({ nodePlatform: expect.stringMatching(/darwin|linux|win32/), nodeVersion: process.versions.node,