Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
test: update some required properties
Browse files Browse the repository at this point in the history
  • Loading branch information
sor4chi committed Apr 10, 2024
1 parent 945e31f commit 4bad6f6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"dependencies": {
"@iarna/toml": "^2.2.5",
"@twrangler/schema": "workspace:*"
},
"devDependencies": {
"dedent": "^1.5.1"
}
}
11 changes: 10 additions & 1 deletion packages/core/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Twrangler } from ".";
import dedent from "dedent";

describe("Twrangler", () => {
describe("create instance", () => {
it("should load a valid config", () => {
const rawConfig = {
name: "my-project",
main: "src/index.ts",
compatibility_date: "2022-03-21",
};
const twrangler = new Twrangler(rawConfig);
expect(twrangler.config).toEqual(rawConfig);
Expand All @@ -22,9 +25,15 @@ describe("Twrangler", () => {
it("should return a valid TOML string", () => {
const rawConfig = {
name: "my-project",
main: "src/index.ts",
compatibility_date: "2022-03-21",
};
const twrangler = new Twrangler(rawConfig);
expect(twrangler.toToml()).toEqual(`name = "my-project"\n`);
expect(twrangler.toToml().trim()).toEqual(dedent`
name = "my-project"
main = "src/index.ts"
compatibility_date = "2022-03-21"
`);
});
});
});
13 changes: 13 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4bad6f6

Please sign in to comment.