-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: switch to d2l-test-runner and new vdiffs
- Loading branch information
Showing
17 changed files
with
82 additions
and
132 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
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 |
---|---|---|
|
@@ -17,5 +17,5 @@ npm run lint:eslint | |
npm run lint:style | ||
|
||
# unit tests | ||
npm run test:headless | ||
npm run test:unit | ||
``` |
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 |
---|---|---|
@@ -1,14 +1,12 @@ | ||
{ | ||
"scripts": { | ||
"test": "npm run lint && npm run test:headless", | ||
"test:headless": "web-test-runner --files \"./test/**/*.test.js\" --node-resolve", | ||
"test:headless:watch": "web-test-runner --files \"./test/**/*.test.js\" --node-resolve --watch" | ||
"test": "npm run lint && npm run test:unit", | ||
"test:unit": "d2l-test-runner" | ||
}, | ||
"dependencies": { | ||
"@brightspace-ui/core": "^2" | ||
}, | ||
"devDependencies": { | ||
"@open-wc/testing": "^3", | ||
"@web/test-runner": "^0.17" | ||
"@brightspace-ui/testing": "^1" | ||
} | ||
} |
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,24 @@ | ||
import { copyFile, copyFilesInDir, getDestinationPath, mergeJSON, mergeText, replaceText } from '../../helper.js'; | ||
|
||
export function run(templateData) { | ||
mergeJSON( | ||
`${__dirname}/templates/configured/_package.json`, | ||
`${getDestinationPath(templateData.hyphenatedName)}/package.json` | ||
); | ||
mergeText( | ||
`${__dirname}/templates/_README.md`, | ||
`${getDestinationPath(templateData.hyphenatedName)}/README.md` | ||
); | ||
mergeText( | ||
`${__dirname}/templates/_gitignore`, | ||
`${getDestinationPath(templateData.hyphenatedName)}/.gitignore` | ||
); | ||
|
||
copyFile( | ||
`${__dirname}/templates/_element.vdiff.js`, | ||
`${getDestinationPath(templateData.hyphenatedName)}/test/${templateData.hyphenatedName}.vdiff.js` | ||
); | ||
replaceText(`${getDestinationPath(templateData.hyphenatedName)}/test/${templateData.hyphenatedName}.vdiff.js`, templateData); | ||
|
||
copyFilesInDir(`${__dirname}/templates/static`, getDestinationPath(templateData.hyphenatedName)); | ||
} |
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,10 @@ | ||
|
||
This repo uses [@brightspace-ui/testing](https://github.com/BrightspaceUI/testing)'s vdiff command to perform visual regression testing: | ||
|
||
```shell | ||
# vdiff | ||
npm run test:vdiff | ||
|
||
# re-generate goldens | ||
npm run test:vdiff golden | ||
``` |
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,11 @@ | ||
import '../<%= hyphenatedName %>.js'; | ||
import { expect, fixture, html } from '@brightspace-ui/testing'; | ||
|
||
describe('<%= tagName %>', () => { | ||
|
||
it('default', async() => { | ||
const elem = await fixture(html`<<%= tagName %>></<%= tagName %>>`); | ||
await expect(elem).to.be.golden(); | ||
}); | ||
|
||
}); |
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 @@ | ||
.vdiff/ |
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,5 @@ | ||
{ | ||
"scripts": { | ||
"test:vdiff": "d2l-test-runner vdiff" | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/generators/test-vdiff/templates/static/.github/workflows/vdiff.yml
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,20 @@ | ||
name: vdiff | ||
on: pull_request | ||
jobs: | ||
vdiff: | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: Brightspace/third-party-actions@actions/checkout | ||
- uses: Brightspace/third-party-actions@actions/setup-node | ||
with: | ||
node-version-file: .nvmrc | ||
- name: Install Dependencies | ||
run: npm install | ||
- name: vdiff Tests | ||
uses: BrightspaceUI/actions/vdiff@main | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/generators/test-visual-diff/templates/_element.visual-diff.html
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
src/generators/test-visual-diff/templates/_element.visual-diff.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/generators/test-visual-diff/templates/static/.github/workflows/visual-diff.yml
This file was deleted.
Oops, something went wrong.