-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: refactor old tests and cleanup test helpers (#873)
- Loading branch information
Showing
89 changed files
with
661 additions
and
4,385 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
File renamed without changes.
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 @@ | ||
console.log("Hello, world!") |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
import dummyPlugin, { dummyCategory } from './dummy.plugin'; | ||
|
||
export default { | ||
plugins: [dummyPlugin()], | ||
categories: [dummyCategory], | ||
}; |
6 changes: 6 additions & 0 deletions
6
e2e/cli-e2e/mocks/fixtures/dummy-setup/code-pushup.config.mjs
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,6 @@ | ||
import dummyPlugin, { dummyCategory } from './dummy.plugin'; | ||
|
||
export default { | ||
plugins: [dummyPlugin()], | ||
categories: [dummyCategory], | ||
}; |
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,6 @@ | ||
import dummyPlugin, { dummyCategory } from './dummy.plugin'; | ||
|
||
export default { | ||
plugins: [dummyPlugin()], | ||
categories: [dummyCategory], | ||
}; |
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,50 @@ | ||
import { readFile } from 'node:fs/promises'; | ||
import { join } from 'node:path'; | ||
import type { PluginConfig } from '@code-pushup/models'; | ||
|
||
export const dummyPluginSlug = 'dummy-plugin'; | ||
|
||
const dummyAuditSlug = 'dummy-audit'; | ||
export const dummyAudit = { | ||
slug: dummyAuditSlug, | ||
title: 'Dummy Audit', | ||
description: 'A dummy audit to test the cli.', | ||
}; | ||
|
||
export const dummyCategory = { | ||
slug: 'dummy-category', | ||
title: 'Dummy Category', | ||
refs: [ | ||
{ | ||
type: 'audit', | ||
plugin: dummyPluginSlug, | ||
slug: dummyAuditSlug, | ||
weight: 1, | ||
}, | ||
], | ||
}; | ||
|
||
export function create(): PluginConfig { | ||
return { | ||
slug: dummyPluginSlug, | ||
title: 'Dummy Plugin', | ||
icon: 'folder-javascript', | ||
description: 'A dummy plugin to test the cli.', | ||
runner: async () => { | ||
const itemCount = JSON.parse( | ||
await readFile(join('src', 'items.json'), 'utf-8'), | ||
).length; | ||
return [ | ||
{ | ||
...dummyAudit, | ||
slug: dummyAuditSlug, | ||
score: itemCount < 10 ? itemCount / 10 : 1, | ||
value: itemCount, | ||
}, | ||
]; | ||
}, | ||
audits: [dummyAudit], | ||
}; | ||
} | ||
|
||
export default create; |
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 @@ | ||
[1, 2, 3] |
45 changes: 45 additions & 0 deletions
45
e2e/cli-e2e/mocks/fixtures/existing-reports/.code-pushup/source-report.json
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,45 @@ | ||
{ | ||
"commit": { | ||
"hash": "11f3153b8df2f5e651a1c72d3ddde3a0f400b8a2", | ||
"message": "Merge branch 'main' into split-compare-e2e", | ||
"date": "2024-11-19T14:28:43.000Z", | ||
"author": "Michael" | ||
}, | ||
"packageName": "@code-pushup/core", | ||
"version": "0.54.0", | ||
"date": "2024-11-19T14:50:29.040Z", | ||
"duration": 64, | ||
"categories": [ | ||
{ | ||
"slug": "dummy-category", | ||
"refs": [ | ||
{ | ||
"slug": "dummy-audit", | ||
"weight": 1, | ||
"type": "audit", | ||
"plugin": "dummy-plugin" | ||
} | ||
], | ||
"title": "Dummy Category" | ||
} | ||
], | ||
"plugins": [ | ||
{ | ||
"title": "Dummy Plugin", | ||
"slug": "dummy-plugin", | ||
"icon": "folder-javascript", | ||
"date": "2024-11-19T14:50:29.080Z", | ||
"duration": 1, | ||
"audits": [ | ||
{ | ||
"slug": "dummy-audit", | ||
"value": 3, | ||
"score": 0.3, | ||
"title": "Dummy Audit", | ||
"description": "A dummy audit to test the cli." | ||
} | ||
], | ||
"description": "A dummy plugin to test the cli." | ||
} | ||
] | ||
} |
Oops, something went wrong.