Skip to content

Commit a5b71ef

Browse files
committed
wip: migrate tests to vitest
1 parent 79eeb1a commit a5b71ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+224
-225
lines changed

packages/i18n/__tests__/date.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import i18n from "@webiny/i18n";
1+
import { describe, test, expect } from "vitest";
2+
import i18n from "~/index";
23

34
describe("date test", () => {
45
// With below given format (no timezone), Date assumes passed value is in current timezone.

packages/i18n/__tests__/datetime.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import i18n from "@webiny/i18n";
1+
import { describe, test, expect } from "vitest";
2+
3+
import i18n from "~/index";
24

35
describe("datetime test", () => {
46
// With below given format (no timezone), Date assumes passed value is in current timezone.

packages/i18n/__tests__/extract.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import extract from "@webiny/i18n/extractor/extract";
1+
import { describe, test, expect } from "vitest";
2+
3+
import extract from "~/extractor/extract";
24

35
import example1 from "./extract/example1";
46
import example2 from "./extract/example2";

packages/i18n/__tests__/extract/example1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default `
2-
import i18n from "@webiny/i18n";
2+
import i18n from "~/index";
33
44
const t1 = i18n.namespace('ns1');
55
const t2 = i18n.namespace('ns2');
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export default 'import i18n from "@webiny/i18n"; const t = i18n.namespace("ns1"); <Typography use={"overline"}>{`status: ${state.data.published ? t`published` : t`draft`}`}</Typography>';
1+
export default 'import i18n from "~/index"; const t = i18n.namespace("ns1"); <Typography use={"overline"}>{`status: ${state.data.published ? t`published` : t`draft`}`}</Typography>';

packages/i18n/__tests__/getSetLocale.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import i18n from "@webiny/i18n";
1+
import { describe, test, expect, beforeEach } from "vitest";
2+
3+
import i18n from "~/index";
24

35
describe("locales set / get test", () => {
46
beforeEach(() => i18n.clearTranslations());

packages/i18n/__tests__/getSetTranslations.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import i18n from "@webiny/i18n";
1+
import { describe, test, expect, beforeEach } from "vitest";
2+
3+
import i18n from "~/index";
24

35
describe("all set/get translations related methods test", () => {
46
beforeEach(() => i18n.clearTranslations());

packages/i18n/__tests__/modifiers.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import i18n, { defaultProcessor, defaultModifiers } from "@webiny/i18n";
1+
import { describe, test, expect } from "vitest";
2+
3+
import i18n, { defaultProcessor, defaultModifiers } from "~/index.js";
24

35
i18n.registerProcessor(defaultProcessor);
46
i18n.registerModifiers(defaultModifiers);

packages/i18n/__tests__/number.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import i18n from "@webiny/i18n";
1+
import { describe, test, expect } from "vitest";
2+
3+
import i18n from "~/index";
24

35
describe("number test", () => {
46
test("should output number with no formatting set", () => {

packages/i18n/__tests__/price.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import i18n from "@webiny/i18n";
1+
import { describe, test, expect } from "vitest";
2+
import i18n from "~/index";
23

34
describe("price test", () => {
45
test("should output price with no formatting set", () => {

0 commit comments

Comments
 (0)