-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: overlay.initialIsOpen is not work
- Loading branch information
Showing
9 changed files
with
72 additions
and
23 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
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
playground/basic/__tests__/__snapshots__/overlay-initialIsOpen-false.spec.ts.snap
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,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`overlay-initialIsOpen-false serve get initial error and subsequent error 1`] = `""`; | ||
|
||
exports[`overlay-initialIsOpen-false serve get initial error and subsequent error 2`] = `""`; | ||
|
||
exports[`overlay-initialIsOpen-false serve get initial error and subsequent error 3`] = `""`; |
5 changes: 5 additions & 0 deletions
5
playground/basic/__tests__/__snapshots__/overlay-terminal-false.spec.ts.snap
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,5 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`overlay-terminal-false serve get initial error and subsequent error 1`] = `"[{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 1 | import { text } from './text'/n 2 |/n > 3 | var hello = 'Hello'/n | ^^^^^^^^^^^^^^^^^^^/n 4 |/n 5 | const rootDom = document.querySelector('#root')! as HTMLElement/n 6 | rootDom.innerHTML = hello + text\\",\\"id\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"level\\":1,\\"loc\\":{\\"column\\":1,\\"file\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"line\\":3},\\"message\\":\\"Unexpected var, use let or const instead.\\",\\"stack\\":\\"\\"},{\\"checkerId\\":\\"ESLint\\",\\"frame\\":\\" 3 | var hello = 'Hello'/n 4 |/n > 5 | const rootDom = document.querySelector('#root')! as HTMLElement/n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/n 6 | rootDom.innerHTML = hello + text/n 7 |/n 8 | export {}\\",\\"id\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"level\\":0,\\"loc\\":{\\"column\\":17,\\"file\\":\\"<PROJECT_ROOT>/temp/basic/src/main.ts\\",\\"line\\":5},\\"message\\":\\"Forbidden non-null assertion.\\",\\"stack\\":\\"\\"}]"`; | ||
|
||
exports[`overlay-terminal-false serve get initial error and subsequent error 2`] = `""`; |
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
53 changes: 53 additions & 0 deletions
53
playground/basic/__tests__/overlay-initialIsOpen-false.spec.ts
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,53 @@ | ||
/* eslint-disable max-nested-callbacks */ | ||
import { | ||
getHmrOverlayText, | ||
killServer, | ||
preTest, | ||
viteServe, | ||
} from 'vite-plugin-checker/__tests__/e2e/Sandbox/Sandbox' | ||
import { | ||
editFile, | ||
sleep, | ||
testDir, | ||
WORKER_CLEAN_TIMEOUT, | ||
} from 'vite-plugin-checker/__tests__/e2e/testUtils' | ||
|
||
import { copyCode } from '../../../scripts/jestSetupFilesAfterEnv' | ||
import { serializers } from '../../../scripts/serializers' | ||
|
||
beforeAll(async () => { | ||
await preTest() | ||
}) | ||
|
||
expect.addSnapshotSerializer(serializers) | ||
|
||
afterAll(async () => { | ||
await sleep(WORKER_CLEAN_TIMEOUT) | ||
}) | ||
|
||
describe('overlay-initialIsOpen-false', () => { | ||
beforeEach(async () => { | ||
await copyCode() | ||
}) | ||
|
||
describe('serve', () => { | ||
afterEach(async () => { | ||
await killServer() | ||
}) | ||
|
||
it('get initial error and subsequent error', async () => { | ||
editFile('vite.config.ts', (code) => | ||
code.replace(`// edit-slot`, `overlay: { initialIsOpen: false },`) | ||
) | ||
await viteServe({ | ||
cwd: testDir, | ||
launchPage: true, | ||
}) | ||
await sleep(6000) | ||
const [message, file, frame] = await getHmrOverlayText() | ||
expect(message).toMatchSnapshot() | ||
expect(file).toMatchSnapshot() | ||
expect(frame).toMatchSnapshot() | ||
}) | ||
}) | ||
}) |
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