File tree Expand file tree Collapse file tree 7 files changed +67
-1
lines changed Expand file tree Collapse file tree 7 files changed +67
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Run tests
2+ on :
3+ pull_request :
4+ push :
5+ branches :
6+ - main
7+ jobs :
8+ test :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v3
12+ with :
13+ submodules : true
14+ - name : use node.js v18.x
15+ uses : actions/setup-node@v3
16+ with :
17+ node-version : 18.x
18+ - run : npm ci
19+ - run : npm test
Original file line number Diff line number Diff line change 1+ # used for testing only
2+ test /temporal-polyfill
3+
14# Logs
25logs
36* .log
Original file line number Diff line number Diff line change 1+ {
2+ "cSpell.words" : [
3+ " NOINPUT" ,
4+ " runtest"
5+ ]
6+ }
Original file line number Diff line number Diff line change 44 "description" : " Lightweight runner for ECMAScript Temporal's Test262 tests" ,
55 "main" : " index.mjs" ,
66 "scripts" : {
7- "test" : " echo \" No tests included yet \" && exit 1 "
7+ "test" : " test/test.sh "
88 },
99 "repository" : {
1010 "type" : " git" ,
Original file line number Diff line number Diff line change 1+ import fs from 'fs' ;
2+ const PKG = JSON . parse ( fs . readFileSync ( '../../package.json' , { encoding : 'utf-8' } ) ) ;
3+ export function resolve ( specifier , parent , defaultResolve ) {
4+ if ( specifier === PKG . name ) {
5+ specifier = new URL ( '../index.mjs' , import . meta. url ) . toString ( ) ;
6+ }
7+ return defaultResolve ( specifier , parent ) ;
8+ }
Original file line number Diff line number Diff line change 1+ // Copy of runtest262.mjs from https://github.com/js-temporal/temporal-polyfill/pull/204
2+ import runTest262 from '@js-temporal/temporal-test262-runner' ;
3+
4+ const isProduction = process . env . NODE_ENV === 'production' ;
5+ const isTranspiledBuild = ! ! process . env . TRANSPILE ;
6+
7+ const expectedFailureFiles = [ 'test/expected-failures.txt' ] ;
8+ if ( isProduction ) {
9+ expectedFailureFiles . push ( isTranspiledBuild ? 'test/expected-failures-es5.txt' : 'test/expected-failures-opt.txt' ) ;
10+ }
11+
12+ const result = runTest262 ( {
13+ test262Dir : 'test262' ,
14+ polyfillCodeFile : 'dist/script.js' ,
15+ expectedFailureFiles,
16+ testGlobs : process . argv . slice ( 2 )
17+ } ) ;
18+
19+ process . exit ( result ? 0 : 1 ) ;
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -ex
4+
5+ cd test
6+ rm -rf temporal-polyfill
7+ git clone --recurse-submodules https://github.com/js-temporal/temporal-polyfill.git
8+ cd temporal-polyfill
9+ npm i
10+ TEST262=1 npm run build
11+ node --loader ../resolve-test.mjs ../runtest262.mjs
You can’t perform that action at this time.
0 commit comments