Skip to content

Commit

Permalink
tests: test the examples using local version of axe (#2309)
Browse files Browse the repository at this point in the history
  • Loading branch information
straker authored Jun 19, 2020
1 parent fb0babe commit 3f13424
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
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

0 comments on commit 3f13424

Please sign in to comment.