File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -14,4 +14,5 @@ inject/chrome.js @jonathanKingston @sammacbeth
14
14
inject /windows.js @ jonathanKingston @ q71114 @ szanto90balazs
15
15
16
16
# Test owners
17
- integration-tests /test-pages / @ kdzwinel @ jonathanKingston
17
+ integration-tests /test-pages / @ kdzwinel @ jonathanKingston
18
+ unit-tests /script-overload-snapshots / @ shakyShane @ jonathanKingston @ englehardt
Original file line number Diff line number Diff line change @@ -3,11 +3,13 @@ import { wrapScriptCodeOverload } from '../src/features/runtime-checks/script-ov
3
3
import { join } from 'node:path'
4
4
import { readFileSync , writeFileSync , readdirSync } from 'node:fs'
5
5
import { cwd } from './script-utils.js'
6
-
7
- // path helpers
8
6
const ROOT = join ( cwd ( import . meta. url ) )
9
7
const configPath = join ( ROOT , '../unit-test/script-overload-snapshots/config' )
10
8
9
+ /**
10
+ * Generates a bunch of snapshots for script-overload.js results using the configs.
11
+ * These are used in unit-test/script-overload.js and ran automatically in automation so that we verify the output is correct.
12
+ */
11
13
function generateOut ( ) {
12
14
const files = readdirSync ( configPath )
13
15
for ( const fileName of files ) {
Original file line number Diff line number Diff line change @@ -3,13 +3,12 @@ import { wrapScriptCodeOverload } from '../src/features/runtime-checks/script-ov
3
3
import { join } from 'node:path'
4
4
import { readFileSync , readdirSync } from 'node:fs'
5
5
import { cwd } from '../scripts/script-utils.js'
6
-
7
- // path helpers
8
6
const ROOT = join ( cwd ( import . meta. url ) )
9
7
const configPath = join ( ROOT , '/script-overload-snapshots/config' )
10
8
11
9
describe ( 'Output validation' , ( ) => {
12
10
it ( 'Given the correct config we should generate expected code output' , ( ) => {
11
+ // Uses the snapshots generated in scripts/generateOverloadSnapshots.js to ensure we don't break the output.
13
12
const files = readdirSync ( configPath )
14
13
for ( const fileName of files ) {
15
14
const config = readFileSync ( join ( configPath , fileName ) ) . toString ( )
You can’t perform that action at this time.
0 commit comments