Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: test the examples using local version of axe #2309

Merged
merged 1 commit into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- checkout
- <<: *restore_dependency_cache_unix
- run: npm run test

# Run the test suite in IE in windows
test_win:
<<: *defaults
Expand All @@ -83,16 +83,16 @@ jobs:
- checkout
# npm i or restore cache
- <<: *restore_dependency_cache_win
# install selenium
# install selenium
- run: |
choco install selenium-ie-driver --version 3.141.5
export PATH=/c/tools/selenium:$PATH
echo $PATH
# build `axe`
- run: npm run build
# get fixtures ready for running tests
- run: npx grunt testconfig
- run: npx grunt fixture
- run: npx grunt testconfig
- run: npx grunt fixture
# run IE webdriver tests
- run: npx grunt connect test-webdriver:ie
# test examples
Expand All @@ -107,6 +107,7 @@ jobs:
steps:
- checkout
- <<: *restore_dependency_cache_unix
- run: npm run build
- run: npm run test:examples

# Test locale files
Expand Down Expand Up @@ -191,7 +192,7 @@ workflows:
requires:
- dependencies_unix
- lint
# Run IE/ Windows test on all commits
# Run IE/ Windows test on all commits
- test_win:
requires:
- dependencies_win
Expand Down
12 changes: 10 additions & 2 deletions doc/examples/test-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ const exampleDirs = readdirSync(__dirname)
const config = { stdio: 'inherit', shell: true };

// run npm install in parallel
function install(dir) {
return execa('npm install', { cwd: dir, ...config });
async function install(dir) {
await execa('npm install', { cwd: dir, ...config });

// override the package version of axe-core with the local version.
// this allows the examples to stay examples while allowing us to
// test them against our changes
return await execa('npm install --no-save file:..\\/..\\/..\\/', {
cwd: dir,
...config
});
}

// run tests synchronously so we can see which one threw an error
Expand Down