Skip to content

Commit 4ce2682

Browse files
committed
Add e2e test
1 parent ab9c667 commit 4ce2682

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@types/mocha": "^9",
4141
"chai": "^4",
4242
"cross-env": "^7",
43+
"i18next": ">=8.4.0",
4344
"mocha": "^9",
4445
"nyc": "^15",
4546
"ts-node": "^10",

src/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"noUnusedLocals": true,
1717
"noUnusedParameters": true,
1818
"noImplicitReturns": true,
19-
"noFallthroughCasesInSwitch": true
19+
"noFallthroughCasesInSwitch": true,
20+
"esModuleInterop": true
2021
},
2122
"exclude": []
22-
}
23+
}

test/e2e.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import "mocha";
2+
import { assert } from "chai";
3+
import { KoreanPostpositionProcessor } from "../src";
4+
import i18next from "i18next";
5+
6+
describe("postposition processor with i18next", () => {
7+
const i18next_config = {
8+
lng: "ko",
9+
postProcess: ["korean-postposition"],
10+
resources: {
11+
ko: {
12+
translation: {
13+
text: "{{some_value}}[[를]] 수정했다.",
14+
},
15+
},
16+
},
17+
};
18+
19+
it("should work without option", () => {
20+
i18next.use(new KoreanPostpositionProcessor());
21+
i18next.init(i18next_config);
22+
assert(i18next.t("text", { some_value: "버그"}), "버그를 수정했다.");
23+
});
24+
});

0 commit comments

Comments
 (0)