Skip to content

Commit

Permalink
Updated tests and CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ethriel3695 committed May 31, 2024
1 parent 7984c96 commit ce82b39
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 21 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
- v4-dependencies-{{ checksum "yarn.lock" }}
- v4-dependencies-
- run: corepack use [email protected]
- run: yarn set version berry
- run: yarn install --immutable

- save_cache:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/chromatic-main-and-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
with:
node-version: lts/*
- run: corepack enable
- run: yarn set version berry
- name: install
run: yarn install --immutable
- uses: chromaui/action@latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/chromatic-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
with:
node-version: lts/*
- run: corepack enable
- run: yarn set version berry
- name: install
run: yarn install --immutable
- uses: chromaui/action@latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/chromatic-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
with:
node-version: lts/*
- run: corepack enable
- run: yarn set version berry
- name: install
run: yarn install --immutable
- uses: chromaui/action-canary@latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
- name: Prepare repository
run: git fetch --unshallow --tags
- run: corepack enable
- run: yarn set version berry
- name: Install dependencies
run: yarn install --immutable

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/smoke-test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
with:
node-version: lts/*
- run: corepack enable
- run: yarn set version berry
- run: yarn
- run: yarn build
- uses: ./
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/smoke-test-node-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
with:
node-version: latest
- run: corepack enable
- run: yarn set version berry
- run: yarn
- run: yarn build
- name: run chromatic via node
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/smoke-test-node18.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
with:
node-version: 18
- run: corepack enable
- run: yarn set version berry
- run: yarn
- run: yarn build
- uses: ./
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/smoke-test-node20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
with:
node-version: 20
- run: corepack enable
- run: yarn set version berry
- run: yarn
- run: yarn build
- uses: ./
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/smoke-test-npx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
with:
node-version: lts/*
- run: corepack enable
- run: yarn set version berry
- name: install
run: yarn && git status --porcelain
- run: yarn build
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/smoke-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
with:
node-version: lts/*
- run: corepack enable
- run: yarn set version berry
- name: install
run: yarn && git status --porcelain
- name: prep package
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/smoke-test-yarn-berry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
node-version: lts/*
- run: rm -rf subdir # remove conflicting subproject
- run: corepack enable
- run: yarn set version berry
- name: install
run: yarn install
env:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/smoke-test-yarn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
with:
node-version: lts/*
- run: corepack enable
- run: yarn set version berry
- run: yarn
- run: yarn build
- run: yarn chromatic --build-script-name build-test-storybook --exit-zero-on-changes --force-rebuild
Expand Down
3 changes: 3 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ ansiHTML.setColors({
cyan: '5fb3b2',
});

// @ts-expect-error chalk is not fully typed
chalk.enabled = true;

chalk.level = 3;

const codeStyle = {
Expand Down
6 changes: 3 additions & 3 deletions node-src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ it('should upload metadata files if --upload-metadata is passed', async () => {
expect(upload.mock.calls.at(-1)[1]).toEqual(
expect.arrayContaining([
{
contentLength: 742,
contentLength: expect.any(Number),
contentType: 'text/typescript',
fileKey: '',
filePath: '.chromatic/main.ts',
Expand All @@ -772,7 +772,7 @@ it('should upload metadata files if --upload-metadata is passed', async () => {
targetPath: '.chromatic/main.ts',
},
{
contentLength: 457,
contentLength: expect.any(Number),
contentType: 'application/json',
fileKey: '',
filePath: '.chromatic/preview-stats.trimmed.json',
Expand All @@ -782,7 +782,7 @@ it('should upload metadata files if --upload-metadata is passed', async () => {
targetPath: '.chromatic/preview-stats.trimmed.json',
},
{
contentLength: 1456,
contentLength: expect.any(Number),
contentType: 'text/typescript',
fileKey: '',
filePath: '.chromatic/preview.tsx',
Expand Down
10 changes: 5 additions & 5 deletions node-src/lib/getDependencies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'path';
import { describe, expect, it } from 'vitest';

import { getDependencies } from './getDependencies';
import packageJson from '../../package.json';
import packageJson from '../__mocks__/dependencyChanges/plain-package.json';
import { checkoutFile } from '../git/git';
import TestLogger from './testLogger';

Expand All @@ -11,9 +11,9 @@ const ctx = { log: new TestLogger() } as any;
describe('getDependencies', () => {
it('should return a set of dependencies', async () => {
const dependencies = await getDependencies(ctx, {
rootPath: path.join(__dirname, '../../'),
manifestPath: 'package.json',
lockfilePath: 'yarn.lock',
rootPath: path.join(__dirname, '../__mocks__/dependencyChanges'),
manifestPath: 'plain-package.json',
lockfilePath: 'plain-yarn.lock',
});

const [dep] = dependencies;
Expand All @@ -22,7 +22,7 @@ describe('getDependencies', () => {
const dependencyNames = Array.from(dependencies).map((dependency) => dependency.split('@@')[0]);
expect(dependencyNames).toEqual(
expect.arrayContaining([
...Object.keys(packageJson.dependencies || {}),
...Object.keys(packageJson.dependencies),
...Object.keys(packageJson.devDependencies),
])
);
Expand Down

0 comments on commit ce82b39

Please sign in to comment.