Skip to content

Commit

Permalink
Fixed issue with multiple integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenewald committed May 14, 2023
1 parent 44652c3 commit e4c3f2a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test('Should have the expected styles', async () => {

afterAll(() => {
// Stop the local server
execSync(`kill $(lsof -t -i:${global.PORT})`, {
execSync(`kill $(lsof -t -i:${global.PORT} -a -c node)`, {
cwd: __dirname,
stdio: 'ignore',
});
Expand Down
3 changes: 2 additions & 1 deletion test/integration/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ module.exports = {
moduleNameMapper: {
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
},
setupFiles: ['./setup.js'],
globalSetup: './setup.js',
globalTeardown: './teardown.js',
testEnvironmentOptions: {
'jest-playwright': {
browsers: ['firefox'],
launchOptions: {
headless: true,
timeout: 500000,
},
},
},
Expand Down
10 changes: 5 additions & 5 deletions test/integration/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ module.exports = async function (globalConfig, projectConfig) {
`cd ${join(
rootPath,
directoryName
)}&& npx create-react-app test-project`,
{ cwd: cwd }
)} && npx create-react-app test-project`,
{ cwd: cwd, stdio: 'inherit' }
);
execSync(`cp -r ${testPackageFilesPath}/* ${testProjectPath}`, {
cwd: cwd,
cwd: cwd
});
//install craco
execSync(`npm install ../../../../../packages/craco`, {
cwd: testProjectPath,
cwd: testProjectPath, stdio: 'inherit'
});
//install other necessary files
execSync(`npm install`, { cwd: testProjectPath });
execSync(`npm install`, { cwd: testProjectPath, stdio: 'inherit' });
//build project
execSync('npm run build', { cwd: testProjectPath, stdio: 'inherit' });
});
Expand Down

0 comments on commit e4c3f2a

Please sign in to comment.