We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16799e5 commit a821147Copy full SHA for a821147
packages/theme-pink-cupcake/src/tests/translator.setup.ts
@@ -0,0 +1,10 @@
1
+import { config } from '@vue/test-utils'
2
+
3
+/**
4
+ * Global mock of the $t and $tdate functions from the i18n plugin
5
+ * @see https://stackoverflow.com/a/73424634/445757
6
+ */
7
+config.global.mocks = {
8
+ $t: (tKey: string): string => tKey, // just return translation key
9
+ $tdate: (date: string): string => date // just return translation key
10
+}
packages/theme-pink-cupcake/vite.config.ts
@@ -39,6 +39,7 @@ export default defineConfig({
39
reportsDirectory: './_meta/_coverage',
40
include: ['src/**/*.*'],
41
},
42
+ setupFiles: ['src/tests/translator.setup.ts'],
43
environment: 'happy-dom'
44
}
45
})
0 commit comments