-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): increase timeout limit (#4411)
- Loading branch information
1 parent
a4cf056
commit 4a7a29e
Showing
21 changed files
with
401 additions
and
331 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,26 +1,32 @@ | ||
import { execSync } from 'node:child_process'; | ||
import path from 'node:path'; | ||
import { globContentJSON } from '@e2e/helper'; | ||
import { expect, test } from '@playwright/test'; | ||
import { globContentJSON, rspackOnlyTest } from '@e2e/helper'; | ||
import { expect } from '@playwright/test'; | ||
|
||
test('should use custom config when using --config option', async () => { | ||
execSync('npx rsbuild build --config ./custom.config.mjs', { | ||
cwd: __dirname, | ||
}); | ||
rspackOnlyTest( | ||
'should use custom config when using --config option', | ||
async () => { | ||
execSync('npx rsbuild build --config ./custom.config.mjs', { | ||
cwd: __dirname, | ||
}); | ||
|
||
const outputs = await globContentJSON(path.join(__dirname, 'dist-custom')); | ||
const outputFiles = Object.keys(outputs); | ||
const outputs = await globContentJSON(path.join(__dirname, 'dist-custom')); | ||
const outputFiles = Object.keys(outputs); | ||
|
||
expect(outputFiles.length > 1).toBeTruthy(); | ||
}); | ||
expect(outputFiles.length > 1).toBeTruthy(); | ||
}, | ||
); | ||
|
||
test('should support custom config to find absolute path', async () => { | ||
const absPath = path.join(__dirname, 'custom.config.mjs'); | ||
execSync(`npx rsbuild build --config ${absPath}`, { | ||
cwd: __dirname, | ||
}); | ||
const outputs = await globContentJSON(path.join(__dirname, 'dist-custom')); | ||
const outputFiles = Object.keys(outputs); | ||
rspackOnlyTest( | ||
'should support custom config to find absolute path', | ||
async () => { | ||
const absPath = path.join(__dirname, 'custom.config.mjs'); | ||
execSync(`npx rsbuild build --config ${absPath}`, { | ||
cwd: __dirname, | ||
}); | ||
const outputs = await globContentJSON(path.join(__dirname, 'dist-custom')); | ||
const outputFiles = Object.keys(outputs); | ||
|
||
expect(outputFiles.length > 1).toBeTruthy(); | ||
}); | ||
expect(outputFiles.length > 1).toBeTruthy(); | ||
}, | ||
); |
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
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 |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import { execSync } from 'node:child_process'; | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
import { expect, test } from '@playwright/test'; | ||
import { rspackOnlyTest } from '@e2e/helper'; | ||
import { expect } from '@playwright/test'; | ||
|
||
test('should allow to custom env prefix via loadEnv method', async () => { | ||
execSync('npx rsbuild build', { | ||
cwd: __dirname, | ||
}); | ||
const content = fs.readFileSync( | ||
path.join(__dirname, 'dist/static/js/index.js'), | ||
'utf-8', | ||
); | ||
expect(content).not.toContain('jack'); | ||
expect(content).toContain('rose'); | ||
}); | ||
rspackOnlyTest( | ||
'should allow to custom env prefix via loadEnv method', | ||
async () => { | ||
execSync('npx rsbuild build', { | ||
cwd: __dirname, | ||
}); | ||
const content = fs.readFileSync( | ||
path.join(__dirname, 'dist/static/js/index.js'), | ||
'utf-8', | ||
); | ||
expect(content).not.toContain('jack'); | ||
expect(content).toContain('rose'); | ||
}, | ||
); |
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
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
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
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
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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
import { execSync } from 'node:child_process'; | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
import { expect, test } from '@playwright/test'; | ||
import { rspackOnlyTest } from '@e2e/helper'; | ||
import { expect } from '@playwright/test'; | ||
|
||
// see: https://github.com/web-infra-dev/rsbuild/issues/2904 | ||
test('should load .env config and set NODE_ENV as expected', async () => { | ||
execSync('npx rsbuild build', { | ||
cwd: __dirname, | ||
}); | ||
expect(fs.existsSync(path.join(__dirname, 'dist/development'))).toBeTruthy(); | ||
}); | ||
rspackOnlyTest( | ||
'should load .env config and set NODE_ENV as expected', | ||
async () => { | ||
execSync('npx rsbuild build', { | ||
cwd: __dirname, | ||
}); | ||
expect( | ||
fs.existsSync(path.join(__dirname, 'dist/development')), | ||
).toBeTruthy(); | ||
}, | ||
); |
Oops, something went wrong.
4a7a29e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Ran ecosystem CI: Open