diff --git a/e2e_tests/tests/cli.test.js b/e2e_tests/tests/cli.test.js index bd756df73..5402bd9ad 100644 --- a/e2e_tests/tests/cli.test.js +++ b/e2e_tests/tests/cli.test.js @@ -26,9 +26,12 @@ describe('KYT CLI', () => { it(`sets up a ${slug} starter-kyt`, () => { const exec = new Promise(resolve => { shell.cd(rootPath); - const child = shell.exec('../packages/kyt-core/lib/index.js setup', (code, stdout) => { - resolve({ code, output: stdout }); - }); + const child = shell.exec( + 'NODE_OPTIONS=--openssl-legacy-provider ../packages/kyt-core/lib/index.js setup', + (code, stdout) => { + resolve({ code, output: stdout }); + } + ); let skdone = false; let chooseDone = false; let ypmDone = false; diff --git a/e2e_tests/tests/kyt-build.test.js b/e2e_tests/tests/kyt-build.test.js index 96d6dc92e..16833f4a1 100644 --- a/e2e_tests/tests/kyt-build.test.js +++ b/e2e_tests/tests/kyt-build.test.js @@ -10,7 +10,9 @@ describe('kyt build', () => { it('should compile files into a build directory', () => { util.setupStageWithFixture(stageName, 'build-default'); - const output = shell.exec('../packages/kyt-core/lib/index.js build'); + const output = shell.exec( + 'NODE_OPTIONS=--openssl-legacy-provider ../packages/kyt-core/lib/index.js build' + ); expect(shell.test('-f', 'build/publicAssets.json')).toBe(true); expect(shell.test('-d', 'build/server')).toBe(true); @@ -46,7 +48,7 @@ describe('kyt build', () => { it('should ignore server build if hasServer=false', () => { util.setupStageWithFixture(stageName, 'build-no-server'); - const output = shell.exec('npm run build'); + const output = shell.exec('NODE_OPTIONS=--openssl-legacy-provider npm run build'); expect(output.code).toBe(0); expect(shell.test('-d', 'build/server')).toBe(false); @@ -54,7 +56,7 @@ describe('kyt build', () => { it('should ignore client build if hasClient=false', () => { util.setupStageWithFixture(stageName, 'build-no-client'); - const output = shell.exec('npm run build'); + const output = shell.exec('NODE_OPTIONS=--openssl-legacy-provider npm run build'); expect(output.code).toBe(0); expect(shell.test('-d', 'build/server')).toBe(true); diff --git a/e2e_tests/tests/starter-kyt.test.js b/e2e_tests/tests/starter-kyt.test.js index 6e78c5435..c12844c20 100644 --- a/e2e_tests/tests/starter-kyt.test.js +++ b/e2e_tests/tests/starter-kyt.test.js @@ -19,7 +19,7 @@ describe('starter kyts', () => { it('should start a dev server on :3000', () => { let outputTest; const run = new Promise(resolve => { - const child = shell.exec(`${kytCli} dev`, () => { + const child = shell.exec(`NODE_OPTIONS=--openssl-legacy-provider ${kytCli} dev`, () => { resolve(outputTest); }); child.stdout.on('data', data => { @@ -38,11 +38,14 @@ describe('starter kyts', () => { it('should build and run', () => { let outputTest; - shell.exec(`${kytCli} build`); + shell.exec(`NODE_OPTIONS=--openssl-legacy-provider ${kytCli} build`); const run = new Promise(resolve => { - const child = shell.exec('node build/server/main.js', () => { - resolve(outputTest); - }); + const child = shell.exec( + 'NODE_OPTIONS=--openssl-legacy-provider node build/server/main.js', + () => { + resolve(outputTest); + } + ); child.stdout.on('data', data => { if (data.includes('✅ server started on port: 3000')) { shell.exec('sleep 5'); @@ -71,7 +74,7 @@ describe('starter kyts', () => { it('should start a server on :3001', () => { let outputTest; const run = new Promise(resolve => { - const child = shell.exec(`${kytCli} dev`, () => { + const child = shell.exec(`NODE_OPTIONS=--openssl-legacy-provider ${kytCli} dev`, () => { resolve(outputTest); }); child.stdout.on('data', data => { @@ -87,7 +90,7 @@ describe('starter kyts', () => { }); it('should build', () => { - const output = shell.exec(`${kytCli} build`); + const output = shell.exec(`NODE_OPTIONS=--openssl-legacy-provider ${kytCli} build`); expect(output.stdout).toContain('✅ Done building');