Skip to content

Commit

Permalink
fix tests to not include test_project ones
Browse files Browse the repository at this point in the history
  • Loading branch information
lilioid committed Sep 13, 2022
1 parent a1b4c27 commit 634f507
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 24 deletions.
44 changes: 24 additions & 20 deletions test/__snapshots__/patch_html.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,37 @@
exports[`replaceCompleteConfig 1`] = `
"<!DOCTYPE html>
<html lang=\\"en\\">
<head>
<meta charset=\\"UTF-8\\" />
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
<meta name=\\"test\\" content=\\"{{ VITE_TEST_IN_HEAD }}\\" />
<title>Vite Test html</title>
</head>
<body>
<h1>Hello {{ VITE_TEST_PERSON_NAME }}</h1>
<script type=\\"application/ecmascript\\">window.config = Object.freeze({\\"VITE_TEST_IN_HEAD\\":\\"test-in-head-value\\",\\"VITE_TEST_PERSON_NAME\\":\\"max mustermann\\"});</script>
</body>
<head>
<meta charset=\\"UTF-8\\" />
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
<meta name=\\"test\\" content=\\"{{ VITE_TEST_IN_HEAD }}\\" />
<title>Vite Test html</title>
</head>
<body>
<h1>Hello {{ VITE_TEST_PERSON_NAME }}</h1>
<script type=\\"application/ecmascript\\">
window.config = Object.freeze({\\"VITE_TEST_IN_HEAD\\":\\"test-in-head-value\\",\\"VITE_TEST_PERSON_NAME\\":\\"max mustermann\\"});
</script>
</body>
</html>
"
`;
exports[`replaceIndividualKeys 1`] = `
"<!DOCTYPE html>
<html lang=\\"en\\">
<head>
<meta charset=\\"UTF-8\\" />
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
<meta name=\\"test\\" content=\\"test-in-head-value\\" />
<title>Vite Test html</title>
</head>
<body>
<h1>Hello max mustermann</h1>
<script type=\\"application/ecmascript\\">window.config = Object.freeze({% VITE_RT_CONFIG %});</script>
</body>
<head>
<meta charset=\\"UTF-8\\" />
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
<meta name=\\"test\\" content=\\"test-in-head-value\\" />
<title>Vite Test html</title>
</head>
<body>
<h1>Hello max mustermann</h1>
<script type=\\"application/ecmascript\\">
window.config = Object.freeze({% VITE_RT_CONFIG %});
</script>
</body>
</html>
"
`;
4 changes: 2 additions & 2 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ beforeAll(() => {
});
});

test.concurrent("generateBundle hook", async () => {
test("generateBundle hook", async () => {
const plugin = runtimeConfig({
emitPatchScript: true,
emitGnuLinuxPatchBinary: true,
Expand All @@ -46,7 +46,7 @@ test.concurrent("generateBundle hook", async () => {
});
});

test.concurrent("configResolved hook", () => {
test("configResolved hook", () => {
const plugin = runtimeConfig();
(plugin.configResolved as MockHook).call(mockPluginContext);
});
4 changes: 2 additions & 2 deletions test/patch_html.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ beforeAll(async () => {
});
});

test.concurrent("replaceIndividualKeys", () => {
test("replaceIndividualKeys", () => {
expect(patch_html.replaceIndividualKeys(html, mock_cfg)).toMatchSnapshot();
});

test.concurrent("replaceCompleteConfig", () => {
test("replaceCompleteConfig", () => {
expect(patch_html.replaceCompleteConfig(html, mock_cfg)).toMatchSnapshot();
});
1 change: 1 addition & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default defineConfig({
},
},
test: {
include: ["test/**.test.ts"],
coverage: {
enabled: true,
provider: "istanbul",
Expand Down

0 comments on commit 634f507

Please sign in to comment.