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:
parent
c7b3367529
commit
9f9dd7220d
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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/"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ async function run() {
|
|||
browser: 'chrome',
|
||||
connectivity: {
|
||||
profile: 'native'
|
||||
}
|
||||
},
|
||||
headless: true
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue