Skip to content
This repository was archived by the owner on Sep 17, 2022. It is now read-only.

Commit e3ade63

Browse files
committed
Update tests
1 parent 2f4d13f commit e3ade63

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

__tests__/__snapshots__/external.spec.ts.snap

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Vitest Snapshot v1
22

33
exports[`external ftl file support mode:development > works with vue 2 1`] = `
4-
"\\\\ assets/external.00e557e3.js
4+
"
55
66
var _missingExportShim = void 0;
77
var da_ftl = new _missingExportShim(\\"\\");
@@ -81,7 +81,7 @@ __component__.fluent[\\"da\\"] = da_ftl;
8181
`;
8282
8383
exports[`external ftl file support mode:development > works with vue 3 1`] = `
84-
"\\\\ assets/external.a1cd7bc1.js
84+
"
8585
8686
var _missingExportShim = void 0;
8787
var da_ftl = new _missingExportShim(\\"\\");
@@ -94,7 +94,7 @@ _sfc_main.fluent[\\"da\\"] = da_ftl;
9494
`;
9595
9696
exports[`external ftl file support mode:development > works with vue 3 rollup plugin 1`] = `
97-
"\\\\ assets/external.74efcebf.js
97+
"
9898
9999
var _missingExportShim = void 0;
100100
var da_ftl = new _missingExportShim(\\"\\");
@@ -115,7 +115,7 @@ script.fluent[\\"da\\"] = da_ftl;
115115
`;
116116
117117
exports[`external ftl file support mode:development > works with vue 3 script setup 1`] = `
118-
"\\\\ assets/external.setup.2a8c1ec1.js
118+
"
119119
120120
var _missingExportShim = void 0;
121121
var en_ftl = new _missingExportShim(\\"# Simple things are simple.\\\\nhello-user = Hello, {$userName}!\\\\n\\\\n# Complex things are possible.\\\\nshared-photos =\\\\n {$userName} {$photoCount ->\\\\n [one] added one photo\\\\n *[other] added {$photoCount} new photos\\\\n } to {$userGender ->\\\\n [male] his stream\\\\n [female] her stream\\\\n *[other] their stream\\\\n }.\\\\n\\");
@@ -135,7 +135,7 @@ _sfc_main.fluent[\\"en\\"] = en_ftl;
135135
`;
136136
137137
exports[`external ftl file support mode:production > works with vue 2 1`] = `
138-
"\\\\ assets/external.48b50c1b.js
138+
"
139139
140140
var _missingExportShim = void 0;
141141
var da_ftl = new _missingExportShim(\\"\\");
@@ -213,7 +213,7 @@ __component__.fluent[\\"da\\"] = da_ftl;
213213
`;
214214
215215
exports[`external ftl file support mode:production > works with vue 3 1`] = `
216-
"\\\\ assets/external.a1cd7bc1.js
216+
"
217217
218218
var _missingExportShim = void 0;
219219
var da_ftl = new _missingExportShim(\\"\\");
@@ -226,7 +226,7 @@ _sfc_main.fluent[\\"da\\"] = da_ftl;
226226
`;
227227
228228
exports[`external ftl file support mode:production > works with vue 3 rollup plugin 1`] = `
229-
"\\\\ assets/external.f9d6970b.js
229+
"
230230
231231
var _missingExportShim = void 0;
232232
var da_ftl = new _missingExportShim(\\"\\");
@@ -246,7 +246,7 @@ script.fluent[\\"da\\"] = da_ftl;
246246
`;
247247
248248
exports[`external ftl file support mode:production > works with vue 3 script setup 1`] = `
249-
"\\\\ assets/external.setup.2a8c1ec1.js
249+
"
250250
251251
var _missingExportShim = void 0;
252252
var en_ftl = new _missingExportShim(\\"# Simple things are simple.\\\\nhello-user = Hello, {$userName}!\\\\n\\\\n# Complex things are possible.\\\\nshared-photos =\\\\n {$userName} {$photoCount ->\\\\n [one] added one photo\\\\n *[other] added {$photoCount} new photos\\\\n } to {$userGender ->\\\\n [male] his stream\\\\n [female] her stream\\\\n *[other] their stream\\\\n }.\\\\n\\");

__tests__/__snapshots__/test.spec.ts.snap

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Vitest Snapshot v1
22

33
exports[`vite plugin mode:development > custom blockType 1`] = `
4-
"\\\\ assets/blockType.a15112ad.js
4+
"
55
66
var _missingExportShim = void 0;
77
function block0(Component) {
@@ -28,7 +28,7 @@ if (typeof block0 === \\"function\\")
2828
`;
2929
3030
exports[`vite plugin mode:development > generates custom block code 1`] = `
31-
"\\\\ assets/test.460d8b2e.js
31+
"
3232
3333
var _missingExportShim = void 0;
3434
function block0(Component) {
@@ -55,7 +55,7 @@ if (typeof block0 === \\"function\\")
5555
`;
5656
5757
exports[`vite plugin mode:development > works with rollup plugin 1`] = `
58-
"\\\\ assets/test.bc87bf83.js
58+
"
5959
6060
var _missingExportShim = void 0;
6161
function render(_ctx, _cache) {
@@ -89,7 +89,7 @@ script.render = render;
8989
`;
9090
9191
exports[`vite plugin mode:development > works with vue 2 1`] = `
92-
"\\\\ assets/test.0cf2e333.js
92+
"
9393
9494
var _missingExportShim = void 0;
9595
var render = function() {
@@ -183,7 +183,7 @@ __component__.options.__file = \\"fixtures/test.vue\\";
183183
`;
184184
185185
exports[`vite plugin mode:production > custom blockType 1`] = `
186-
"\\\\ assets/blockType.a15112ad.js
186+
"
187187
188188
var _missingExportShim = void 0;
189189
function block0(Component) {
@@ -210,7 +210,7 @@ if (typeof block0 === \\"function\\")
210210
`;
211211
212212
exports[`vite plugin mode:production > generates custom block code 1`] = `
213-
"\\\\ assets/test.460d8b2e.js
213+
"
214214
215215
var _missingExportShim = void 0;
216216
function block0(Component) {
@@ -237,7 +237,7 @@ if (typeof block0 === \\"function\\")
237237
`;
238238
239239
exports[`vite plugin mode:production > works with rollup plugin 1`] = `
240-
"\\\\ assets/test.bc87bf83.js
240+
"
241241
242242
var _missingExportShim = void 0;
243243
function render(_ctx, _cache) {
@@ -271,7 +271,7 @@ script.render = render;
271271
`;
272272
273273
exports[`vite plugin mode:production > works with vue 2 1`] = `
274-
"\\\\ assets/test.70edb105.js
274+
"
275275
276276
var _missingExportShim = void 0;
277277
var render = function() {

__tests__/util/helpers.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const testBundle = async(options: InlineConfig, file: string): Promise<st
1515
shimMissingExports: true,
1616
},
1717
minify: false,
18+
write: false,
1819
},
1920
plugins: [
2021
...(options.plugins as any),
@@ -34,6 +35,6 @@ export const testBundle = async(options: InlineConfig, file: string): Promise<st
3435
const output = (out as any).output
3536

3637
return output
37-
?.map((o: { code: string, fileName: string }) => `\\ ${o.fileName}\n\n${o.code}`)
38+
?.map((o: { code: string }) => `\n\n${o.code}`)
3839
.join('\n')
3940
}

0 commit comments

Comments
 (0)