-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): split slow test file (#4310)
- Loading branch information
1 parent
e38ac79
commit ba8a1d9
Showing
6 changed files
with
204 additions
and
167 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { rspackOnlyTest } from '@e2e/helper'; | ||
import { createAndValidate } from './helper'; | ||
|
||
rspackOnlyTest('should create vanilla project as expected', async () => { | ||
await createAndValidate(__dirname, 'vanilla'); | ||
}); | ||
|
||
rspackOnlyTest('should create vanilla-ts project as expected', async () => { | ||
await createAndValidate(__dirname, 'vanilla-ts'); | ||
}); | ||
|
||
rspackOnlyTest('should allow to create project in sub dir', async () => { | ||
await createAndValidate(__dirname, 'vanilla', { | ||
name: 'test-temp-dir/rsbuild-project', | ||
}); | ||
}); | ||
|
||
rspackOnlyTest('should allow to create project in relative dir', async () => { | ||
await createAndValidate(__dirname, 'vanilla', { | ||
name: './test-temp-relative-dir', | ||
}); | ||
}); |
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 was deleted.
Oops, something went wrong.
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,45 @@ | ||
import { rspackOnlyTest } from '@e2e/helper'; | ||
import { expect } from '@playwright/test'; | ||
import { createAndValidate } from './helper'; | ||
|
||
rspackOnlyTest('should create react project as expected', async () => { | ||
const { pkgJson } = await createAndValidate(__dirname, 'react'); | ||
expect(pkgJson.dependencies.react).toBeTruthy(); | ||
expect(pkgJson.dependencies['react-dom']).toBeTruthy(); | ||
expect(pkgJson.devDependencies['@rsbuild/plugin-react']).toBeTruthy(); | ||
}); | ||
|
||
rspackOnlyTest('should create preact project as expected', async () => { | ||
const { pkgJson } = await createAndValidate(__dirname, 'preact'); | ||
expect(pkgJson.dependencies.preact).toBeTruthy(); | ||
expect(pkgJson.devDependencies['@rsbuild/plugin-preact']).toBeTruthy(); | ||
}); | ||
|
||
rspackOnlyTest('should create vue3 project as expected', async () => { | ||
const { pkgJson } = await createAndValidate(__dirname, 'vue3'); | ||
expect(pkgJson.dependencies.vue).toBeTruthy(); | ||
expect(pkgJson.devDependencies['@rsbuild/plugin-vue']).toBeTruthy(); | ||
}); | ||
|
||
rspackOnlyTest('should create vue2 project as expected', async () => { | ||
const { pkgJson } = await createAndValidate(__dirname, 'vue2'); | ||
expect(pkgJson.dependencies.vue).toBeTruthy(); | ||
expect(pkgJson.devDependencies['@rsbuild/plugin-vue2']).toBeTruthy(); | ||
}); | ||
|
||
rspackOnlyTest('should create lit project as expected', async () => { | ||
const { pkgJson } = await createAndValidate(__dirname, 'lit'); | ||
expect(pkgJson.dependencies.lit).toBeTruthy(); | ||
}); | ||
|
||
rspackOnlyTest('should create solid project as expected', async () => { | ||
const { pkgJson } = await createAndValidate(__dirname, 'solid'); | ||
expect(pkgJson.dependencies['solid-js']).toBeTruthy(); | ||
expect(pkgJson.devDependencies['@rsbuild/plugin-solid']).toBeTruthy(); | ||
}); | ||
|
||
rspackOnlyTest('should create svelte project as expected', async () => { | ||
const { pkgJson } = await createAndValidate(__dirname, 'svelte'); | ||
expect(pkgJson.dependencies.svelte).toBeTruthy(); | ||
expect(pkgJson.devDependencies['@rsbuild/plugin-svelte']).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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { existsSync } from 'node:fs'; | ||
import { join } from 'node:path'; | ||
import { rspackOnlyTest } from '@e2e/helper'; | ||
import { expect } from '@playwright/test'; | ||
import { createAndValidate } from './helper'; | ||
|
||
rspackOnlyTest('should create project with eslint as expected', async () => { | ||
const { dir, pkgJson, clean } = await createAndValidate( | ||
__dirname, | ||
'vanilla', | ||
{ | ||
name: 'test-temp-eslint', | ||
tools: ['eslint'], | ||
clean: false, | ||
}, | ||
); | ||
expect(pkgJson.devDependencies.eslint).toBeTruthy(); | ||
expect(existsSync(join(dir, 'eslint.config.mjs'))).toBeTruthy(); | ||
await clean(); | ||
}); | ||
|
||
rspackOnlyTest('should create project with prettier as expected', async () => { | ||
const { dir, pkgJson, clean } = await createAndValidate( | ||
__dirname, | ||
'vanilla', | ||
{ | ||
name: 'test-temp-prettier', | ||
tools: ['prettier'], | ||
clean: false, | ||
}, | ||
); | ||
expect(pkgJson.devDependencies.prettier).toBeTruthy(); | ||
expect(existsSync(join(dir, '.prettierrc'))).toBeTruthy(); | ||
await clean(); | ||
}); | ||
|
||
rspackOnlyTest( | ||
'should create project with eslint and prettier as expected', | ||
async () => { | ||
const { dir, pkgJson, clean } = await createAndValidate( | ||
__dirname, | ||
'vanilla', | ||
{ | ||
name: 'test-temp-eslint-prettier', | ||
tools: ['eslint', 'prettier'], | ||
clean: false, | ||
}, | ||
); | ||
expect(pkgJson.devDependencies.eslint).toBeTruthy(); | ||
expect(pkgJson.devDependencies.prettier).toBeTruthy(); | ||
expect(existsSync(join(dir, '.prettierrc'))).toBeTruthy(); | ||
expect(existsSync(join(dir, 'eslint.config.mjs'))).toBeTruthy(); | ||
await clean(); | ||
}, | ||
); | ||
|
||
rspackOnlyTest('should create project with biome as expected', async () => { | ||
const { dir, pkgJson, clean } = await createAndValidate( | ||
__dirname, | ||
'vanilla', | ||
{ | ||
name: 'test-temp-eslint', | ||
tools: ['biome'], | ||
clean: false, | ||
}, | ||
); | ||
expect(pkgJson.devDependencies['@biomejs/biome']).toBeTruthy(); | ||
expect(existsSync(join(dir, 'biome.json'))).toBeTruthy(); | ||
await clean(); | ||
}); |
Oops, something went wrong.
ba8a1d9
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