Skip to content

Commit

Permalink
karma crashes when using allure report in watch mode (fix #12, via #15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vorobeyko authored Jan 30, 2020
1 parent 2e86a37 commit 9d80d59
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/mr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run Unit tests

on: [push]

jobs:
install-and-tests:
name: Installing dependencies and running tests
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [8.x, 10.x, 12.x]

steps:
- name: Checkout repository
uses: actions/checkout@v1
- uses: actions/setup-node@v1
- name: Installing dependencies
run: npm install
- name: Running unit tests
run: npm run unit
- name: Running e2e tests
run: |
FIREFOX_BIN=/usr/bin/firefox npm run e2e-test
if [ "$(ls -A test/e2e/out)" ]; then echo "Not Empty"; else echo "Allure output directory is empty"; exit 1; fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test": "npm run unit && npm run e2e-test",
"unit": "jasmine JASMINE_CONFIG_PATH=test/jasmine.json",
"e2e-clean": "rm -rf test/e2e/out",
"e2e-test": "npm run e2e-clean && node test/e2e/test-runner.js && allure generate -c test/e2e/out"
"e2e-test": "npm run e2e-clean && node test/e2e/test-runner.js"
},
"dependencies": {
"allure-js-commons": "1.3.2"
Expand Down
1 change: 1 addition & 0 deletions src/AllureReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function AllureReporter(baseReporterDecorator, config) {
return Math.max(stop, result.stop);
}, Number.NEGATIVE_INFINITY);
this.allure.endSuite(stopTime);
delete this.suites[suite];
}, this);
};

Expand Down
8 changes: 7 additions & 1 deletion test/e2e/test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var karmaConfig = {
],
port: 9876,
colors: true,
browsers: ['PhantomJS', 'Firefox'],
browsers: ['PhantomJS', 'FirefoxHeadless'],
captureTimeout: 60000,
singleRun: true,

Expand All @@ -19,6 +19,12 @@ var karmaConfig = {
'karma-phantomjs-launcher',
'karma-firefox-launcher'
],
customLaunchers: {
FirefoxHeadless: {
base: 'Firefox',
flags: [ '-headless' ],
},
},
allureReport: {
reportDir: 'out'
}
Expand Down
File renamed without changes.

0 comments on commit 9d80d59

Please sign in to comment.