Skip to content

Commit

Permalink
chore: update vitest to 1.0.0-beta.6 (#15194)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Nov 30, 2023
1 parent 733fab8 commit 2fce647
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 215 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"unbuild": "^2.0.0",
"vite": "workspace:*",
"vitepress": "1.0.0-rc.31",
"vitest": "^0.34.6",
"vitest": "^1.0.0-beta.6",
"vue": "^3.3.9"
},
"simple-git-hooks": {
Expand Down
24 changes: 12 additions & 12 deletions packages/vite/src/node/__tests__/plugins/css.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,15 @@ describe('hoist @ rules', () => {
@import "baz";`
const result = await hoistAtRules(css)
expect(result).toMatchInlineSnapshot(`
"@charset \\"utf-8\\";@import \\"baz\\";
"@charset "utf-8";@import "baz";
.foo{color:red;}
/*
@import \\"bla\\";
@import "bla";
*/
/*
@charset \\"utf-8\\";
@import \\"bar\\";
@charset "utf-8";
@import "bar";
*/
"
`)
Expand Down Expand Up @@ -271,9 +271,9 @@ import "other-module";`
const replaced = replacer(code)
expect(replaced.length).toBe(code.length)
expect(replaced).toMatchInlineSnapshot(`
"import \\"some-module\\";
"import "some-module";
/* empty css */
import \\"other-module\\";"
import "other-module";"
`)
})

Expand All @@ -284,7 +284,7 @@ import "other-module";`
const replaced = replacer(code)
expect(replaced.length).toBe(code.length)
expect(replaced).toMatchInlineSnapshot(
'"import \\"some-module\\";/* empty css */import \\"other-module\\";"',
`"import "some-module";/* empty css */import "other-module";"`,
)
})

Expand All @@ -298,9 +298,9 @@ require("other-module");`
const replaced = replacer(code)
expect(replaced.length).toBe(code.length)
expect(replaced).toMatchInlineSnapshot(`
"require(\\"some-module\\");
"require("some-module");
;/* empty css */
require(\\"other-module\\");"
require("other-module");"
`)
})

Expand All @@ -311,7 +311,7 @@ require("other-module");`
const replaced = replacer(code)
expect(replaced.length).toBe(code.length)
expect(replaced).toMatchInlineSnapshot(
'"require(\\"some-module\\");;/* empty css */require(\\"other-module\\");"',
`"require("some-module");;/* empty css */require("other-module");"`,
)
})

Expand All @@ -322,7 +322,7 @@ require("other-module");`
const replacer = getEmptyChunkReplacer(['pure_css_chunk.js'], 'cjs')
const newCode = replacer(code)
expect(newCode).toMatchInlineSnapshot(
'"require(\\"some-module\\"),/* empty css */require(\\"other-module\\");"',
`"require("some-module"),/* empty css */require("other-module");"`,
)
// So there should be no pure css chunk anymore
expect(newCode.match(/pure_css_chunk\.js/)).toBeNull()
Expand All @@ -334,7 +334,7 @@ require("other-module");`

const replacer = getEmptyChunkReplacer(['pure_css_chunk.js'], 'cjs')
expect(replacer(code)).toMatchInlineSnapshot(
'"require(\\"some-module\\");/* empty css */const v=require(\\"other-module\\");"',
`"require("some-module");/* empty css */const v=require("other-module");"`,
)
})
})
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`parse positives > ? in url 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"./mo\\\\\\\\?ds/*.js\\", {\\"as\\":\\"url\\",\\"import\\":\\"*\\"})), \`./mo?ds/\${base ?? foo}.js\`)"`;
exports[`parse positives > ? in url 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("./mo\\\\?ds/*.js", {"as":"url","import":"*"})), \`./mo?ds/\${base ?? foo}.js\`)"`;
exports[`parse positives > ? in variables 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"./mods/*.js\\", {\\"as\\":\\"raw\\",\\"import\\":\\"*\\"})), \`./mods/\${base ?? foo}.js\`)"`;
exports[`parse positives > ? in variables 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("./mods/*.js", {"as":"raw","import":"*"})), \`./mods/\${base ?? foo}.js\`)"`;
exports[`parse positives > ? in worker 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"./mo\\\\\\\\?ds/*.js\\", {\\"as\\":\\"worker\\",\\"import\\":\\"*\\"})), \`./mo?ds/\${base ?? foo}.js\`)"`;
exports[`parse positives > ? in worker 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("./mo\\\\?ds/*.js", {"as":"worker","import":"*"})), \`./mo?ds/\${base ?? foo}.js\`)"`;
exports[`parse positives > alias path 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"./mods/*.js\\")), \`./mods/\${base}.js\`)"`;
exports[`parse positives > alias path 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("./mods/*.js")), \`./mods/\${base}.js\`)"`;
exports[`parse positives > basic 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"./mods/*.js\\")), \`./mods/\${base}.js\`)"`;
exports[`parse positives > basic 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("./mods/*.js")), \`./mods/\${base}.js\`)"`;
exports[`parse positives > with ../ and itself 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"../dynamicImportVar/*.js\\")), \`./\${name}.js\`)"`;
exports[`parse positives > with ../ and itself 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("../dynamicImportVar/*.js")), \`./\${name}.js\`)"`;
exports[`parse positives > with multi ../ and itself 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"../../plugins/dynamicImportVar/*.js\\")), \`./\${name}.js\`)"`;
exports[`parse positives > with multi ../ and itself 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("../../plugins/dynamicImportVar/*.js")), \`./\${name}.js\`)"`;
exports[`parse positives > with query 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"./mods/*.js\\", {\\"query\\":{\\"foo\\":\\"bar\\"}})), \`./mods/\${base}.js\`)"`;
exports[`parse positives > with query 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("./mods/*.js", {"query":{"foo":"bar"}})), \`./mods/\${base}.js\`)"`;
exports[`parse positives > with query raw 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"./mods/*.js\\", {\\"as\\":\\"raw\\",\\"import\\":\\"*\\"})), \`./mods/\${base}.js\`)"`;
exports[`parse positives > with query raw 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("./mods/*.js", {"as":"raw","import":"*"})), \`./mods/\${base}.js\`)"`;
exports[`parse positives > with query url 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"./mods/*.js\\", {\\"as\\":\\"url\\",\\"import\\":\\"*\\"})), \`./mods/\${base}.js\`)"`;
exports[`parse positives > with query url 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob("./mods/*.js", {"as":"url","import":"*"})), \`./mods/\${base}.js\`)"`;
Loading

0 comments on commit 2fce647

Please sign in to comment.