Fix failing unit test setup for GitHub Actions (#3057)

* fix the tests one by one

* Add missing line feed

* more cleanup
This commit is contained in:
Peter Hedenskog 2020-06-23 13:17:00 +02:00 committed by GitHub
parent c7b3367529
commit 9f9dd7220d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View File

@ -29,7 +29,9 @@ jobs:
firefox --version
- name: Verify clean CSS
run: npm run build:css && test -z "$(git status --porcelain lib/plugins/html/assets/css/index.css)"
- name: Verify lint
run: npm run lint
- name: Lint pug
run: npm run pug-lint
- name: Run unit tests
uses: GabrielBB/xvfb-action@v1.2
with:
run: npm run lint-and-unit
run: npm run test

View File

@ -5,9 +5,9 @@ if pageInfo.data.browsertime.run && pageInfo.data.browsertime.run.screenshots
each screenshot in pageInfo.data.browsertime.run.screenshots
- filename = screenshot.substring(screenshot.lastIndexOf('/') + 1, screenshot.length)
- screenshotName = rootPath + screenshot
- style = options.mobile || options.android || options.safari.ios ? 'max-width: 50%' : 'max-width: 100%'
- style = options.mobile || options.android || (options.safari && options.safari.ios) ? 'max-width: 50%' : 'max-width: 100%'
a(href=screenshotName)
img.screenshot(src=screenshotName, alt=filename, style=style)
p #{filename}
else
p No screenshots.
p No screenshots.

View File

@ -41,7 +41,6 @@
"pug-lint": "pug-lint lib/plugins/html/templates",
"test": "mocha",
"check-licenses": "tools/check-licenses.js",
"lint-and-unit": "npm run eslint-check && npm run lint && npm run test",
"build:css": "node-sass lib/plugins/html/src/sass/main.scss > lib/plugins/html/assets/css/index.css && cleancss -o lib/plugins/html/assets/css/index.min.css lib/plugins/html/assets/css/index.css && rm lib/plugins/html/assets/css/index.css",
"generate:assets": "mkdir -p assets/$npm_package_version && cp -R lib/plugins/html/assets/ assets/$npm_package_version/"
},

View File

@ -10,7 +10,8 @@ async function run() {
browser: 'chrome',
connectivity: {
profile: 'native'
}
},
headless: true
}
});