-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecfeeb7
commit bfb9fc6
Showing
25 changed files
with
1,061 additions
and
336 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 |
---|---|---|
|
@@ -6,3 +6,4 @@ playwright-report/ | |
test-results/ | ||
.svelte-kit/ | ||
dist.tar.gz | ||
.nyc_output/ |
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ node_modules | |
dist | ||
.angular | ||
coverage/ | ||
.nyc_output/ | ||
playwright-report/ | ||
test-results/ | ||
.svelte-kit/ |
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,15 @@ | ||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(js|ts)$/, | ||
loader: 'coverage-istanbul-loader', | ||
options: {esModules: true}, | ||
enforce: 'post', | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
include: [require('path').join(__dirname, '..', 'lib', 'src'), require('path').join(__dirname, '..', '..', 'core')], | ||
exclude: [/\.(e2e|spec|po)\.ts$/, /node_modules/, /(ngfactory|ngstyle)\.js/], | ||
}, | ||
], | ||
}, | ||
}; |
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,15 @@ | ||
import {test as base} from '@playwright/test'; | ||
import {promises as fs} from 'fs'; | ||
import path from 'path'; | ||
import {v4 as uuidv4} from 'uuid'; | ||
|
||
export const test = base.extend({}); | ||
test.afterEach(async ({page}) => { | ||
const coverage: string = await page.evaluate(() => { | ||
return JSON.stringify((window as any).__coverage__); | ||
}); | ||
if (coverage) { | ||
await fs.writeFile(path.join(__dirname, '.nyc_output', `${uuidv4()}.json`), coverage); | ||
} | ||
}); | ||
export {expect} from '@playwright/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
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,28 @@ | ||
import NYC from 'nyc'; | ||
import {promises as fs} from 'fs'; | ||
import {rm} from 'fs/promises'; | ||
import path from 'path'; | ||
|
||
async function globalSetup() { | ||
console.log('Cleaning up coverage folders...'); | ||
const nycDir = path.join('e2e', '.nyc_output'); | ||
const reportDir = path.join('e2e', 'coverage'); | ||
await rm(nycDir, {recursive: true, force: true}); | ||
await fs.mkdir(nycDir); | ||
await rm(reportDir, {recursive: true, force: true}); | ||
await fs.mkdir(reportDir); | ||
console.log('Coverage setup ready !'); | ||
const nycInstance = new NYC({ | ||
cwd: __dirname, | ||
['report-dir']: reportDir, | ||
reporter: ['lcov', 'json', 'text-summary'], | ||
extension: ['.ts', '.tsx', '.svelte'], | ||
}); | ||
return async () => { | ||
console.log('Saving coverage report...'); | ||
await nycInstance.report(); | ||
console.log('Coverage report saved !'); | ||
}; | ||
} | ||
|
||
export default globalSetup; |
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
Oops, something went wrong.