未验证 提交 d0818675 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #19556 from munrocket/crossenv

Package.json: remove cross-env
......@@ -425,58 +425,6 @@
"integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=",
"dev": true
},
"cross-env": {
"version": "7.0.2",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz",
"integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.1"
},
"dependencies": {
"cross-spawn": {
"version": "7.0.2",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz",
"integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==",
"dev": true,
"requires": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
}
},
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true
},
"shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"requires": {
"shebang-regex": "^3.0.0"
}
},
"shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
}
}
},
"cross-spawn": {
"version": "7.0.2",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz",
......@@ -1506,7 +1454,7 @@
},
"os-tmpdir": {
"version": "1.0.2",
"resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true
},
......@@ -1976,7 +1924,7 @@
},
"through": {
"version": "2.3.8",
"resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
"dev": true
},
......
......@@ -56,7 +56,7 @@
"test-unit": "npm run unit --prefix test",
"test-e2e": "node test/e2e/puppeteer.js",
"test-e2e-cov": "node test/e2e/check-coverage.js",
"make-screenshot": "cross-env MAKE=true node test/e2e/puppeteer.js"
"make-screenshot": "node test/e2e/puppeteer.js --make"
},
"keywords": [
"three",
......@@ -83,7 +83,6 @@
"@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.26.0",
"concurrently": "^5.2.0",
"cross-env": "^7.0.2",
"eslint": "^7.0.0",
"eslint-config-mdcs": "^5.0.0",
"eslint-plugin-html": "^6.0.2",
......
......@@ -108,12 +108,16 @@ const pup = puppeteer.launch( {
/* Find files */
const exactList = process.argv.slice( 2 ).map( f => f.replace( '.html', '' ) );
const isMakeScreenshot = process.argv[ 2 ] == '--make';
const isExactList = process.argv.length > ( 2 + isMakeScreenshot );
const exactList = process.argv.slice( isMakeScreenshot ? 3 : 2 )
.map( f => f.replace( '.html', '' ) );
const files = fs.readdirSync( './examples' )
.filter( s => s.slice( - 5 ) === '.html' )
.map( s => s.slice( 0, s.length - 5 ) )
.filter( f => ( process.argv.length > 2 ) ? exactList.includes( f ) : ! exceptionList.includes( f ) );
.filter( f => isExactList ? exactList.includes( f ) : ! exceptionList.includes( f ) );
/* Loop for each file, with CI parallelism */
......@@ -129,7 +133,7 @@ const pup = puppeteer.launch( {
/* At least 3 attempts before fail */
let attemptId = process.env.MAKE ? 1.5 : 0;
let attemptId = isMakeScreenshot ? 1.5 : 0;
while ( attemptId < maxAttemptId ) {
......@@ -218,7 +222,7 @@ const pup = puppeteer.launch( {
}
if ( process.env.MAKE ) {
if ( isMakeScreenshot ) {
/* Make screenshots */
......@@ -315,7 +319,7 @@ const pup = puppeteer.launch( {
console.red( `TEST FAILED! ${ failedScreenshots.length } from ${ endId - beginId } screenshots not pass.` );
} else if ( ! process.env.MAKE ) {
} else if ( ! isMakeScreenshot ) {
console.green( `TEST PASSED! ${ endId - beginId } screenshots correctly rendered.` );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册