Skip to content

Commit

Permalink
Merge pull request #16744 from storybookjs/windows-tests
Browse files Browse the repository at this point in the history
Build: Run unit tests on more node versions, mac, and windows
  • Loading branch information
shilman authored Dec 15, 2021
2 parents 8041052 + dacc755 commit e7b8c49
Show file tree
Hide file tree
Showing 59 changed files with 7,378 additions and 176 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ module.exports = {
extends: ['@storybook/eslint-config-storybook', 'plugin:storybook/recommended'],
rules: {
'@typescript-eslint/ban-ts-comment': 'warn',
'jest/no-standalone-expect': [
'error',
{ additionalTestBlockFunctions: ['it.skipWindows', 'it.onWindows'] },
],
},
overrides: [
{
Expand Down
30 changes: 25 additions & 5 deletions .github/workflows/tests-unit.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
name: Unit tests

on: [push]
on:
push:
branches:
- next
pull_request:
types: [opened, reopened, labeled, synchronize]

jobs:
build:
name: Core Unit Tests
runs-on: ubuntu-latest
name: Core Unit Tests node-${{ matrix.node_version }}, ${{ matrix.os }}
if: |
${{ github.event.label.name == 'ci:matrix' ||
contains(github.event.pull_request.labels.*.name, 'ci:matrix') ||
github.event.type == 'push'}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node_version: [12, 14, 16]
include:
- os: macos-latest
node_version: 16
- os: windows-latest
node_version: 16
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: "12.x"
node-version: ${{ matrix.node_version }}
cache: yarn
- name: install, bootstrap
run: |
Expand Down
15 changes: 9 additions & 6 deletions addons/a11y/src/components/A11YPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@ describe('A11YPanel', () => {
const { getByText } = render(<ThemedA11YPanel />);
const useChannelArgs = mockedApi.useChannel.mock.calls[0][0];
act(() => useChannelArgs[EVENTS.RESULT](axeResult));
await waitFor(() => {
expect(getByText(/Tests completed/)).toBeTruthy();
expect(getByText(/Violations/)).toBeTruthy();
expect(getByText(/Passes/)).toBeTruthy();
expect(getByText(/Incomplete/)).toBeTruthy();
});
await waitFor(
() => {
expect(getByText(/Tests completed/)).toBeTruthy();
expect(getByText(/Violations/)).toBeTruthy();
expect(getByText(/Passes/)).toBeTruthy();
expect(getByText(/Incomplete/)).toBeTruthy();
},
{ timeout: 2000 }
);
});
});
Loading

0 comments on commit e7b8c49

Please sign in to comment.