Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add login acceptance testing
Added acceptance testing for the login page feature using cucumber and puppeteer. Test script has been changed to run Jest tests followed by Cucumber features. .githooks was also modified to run the test script on pre-commit so that no code should be committed with failing tests.
- Loading branch information
Showing
8 changed files
with
390 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
#!/bin/sh | ||
|
||
echo "running the 'pre-commit' script" | ||
|
||
echo "running eslint..." | ||
./node_modules/.bin/eslint . | ||
|
||
echo "running tests..." | ||
npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -15,5 +15,6 @@ module.exports = { | ||
testPathIgnorePatterns: [ | ||
'/node_modules/', | ||
'/__tests__/fixtures/', | ||
'/tests/test.js' | ||
] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict' | ||
|
||
/* This is the test script */ | ||
|
||
const { exec } = require('child_process') | ||
|
||
let exitCode = 0 | ||
|
||
const handler = (error, stdout, stderr) => { | ||
if (error) { | ||
console.error(error) | ||
exitCode = 1 | ||
} | ||
|
||
if (stderr) console.error(stderr) | ||
if (stdout) console.log(stdout) | ||
} | ||
|
||
console.log('Running Jest...') | ||
exec(`${__dirname}/../node_modules/.bin/jest --runInBand --coverage`, handler) | ||
.on('close', () => { | ||
console.log('Running Cucumber...') | ||
exec(`${__dirname}/../node_modules/.bin/cucumber-js ./tests/features`, handler) | ||
.on('close', () => { | ||
process.exit(exitCode) | ||
}) | ||
}) | ||
|
This file was deleted.
Oops, something went wrong.