-
-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finalized setup and teardown scripts
- Loading branch information
1 parent
820cd93
commit 1964b0d
Showing
12 changed files
with
170 additions
and
518 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
test/integration/fixtures/basic-integration-test/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
const { join } = require('path'); | ||
const { execSync, spawn } = require('child_process'); | ||
|
||
beforeAll(async () => { | ||
// Start a local server to serve the test project | ||
const server = spawn('npx', ['serve', '-s', 'build', '-l', global.PORT], { | ||
cwd: join(__dirname, 'test-project'), | ||
}); | ||
|
||
// Log any server errors to the console | ||
server.stderr.on('data', (data) => { | ||
console.error(`stderr: ${data}`); | ||
}); | ||
|
||
// Leave time for the server to initialize | ||
await new Promise(resolve => {setTimeout(resolve, 3000)}); | ||
}); | ||
|
||
test("Should have the expected styles", async () => { | ||
await page.goto(global.URL, {'waitUntil':'domcontentloaded'}); //todo: make the url changeble | ||
|
||
const cracoTestText = await page.$eval('#craco-test', (element) => element.textContent); | ||
expect(cracoTestText).toBe("CRACO is working!"); | ||
}); | ||
|
||
afterAll(() => { | ||
// Stop the local server | ||
execSync(`kill $(lsof -t -i:${global.PORT})`, { cwd: __dirname, stdio: 'ignore' }); | ||
}); |
File renamed without changes.
69 changes: 69 additions & 0 deletions
69
test/integration/fixtures/basic-integration-test/test-package-files/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
11 changes: 4 additions & 7 deletions
11
...xtures/custom-postcss-config/package.json → ...tion-test/test-package-files/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
68 changes: 0 additions & 68 deletions
68
test/integration/fixtures/custom-postcss-config/index.test.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.