From 4bad6f68acd621381bb35fa019a7111f72f16de0 Mon Sep 17 00:00:00 2001 From: Sor4chi <80559385+sor4chi@users.noreply.github.com> Date: Wed, 10 Apr 2024 19:30:26 +0900 Subject: [PATCH] test: update some required properties --- packages/core/package.json | 3 +++ packages/core/src/index.test.ts | 11 ++++++++++- pnpm-lock.yaml | 13 +++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/packages/core/package.json b/packages/core/package.json index a9593d3..10480c1 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -11,5 +11,8 @@ "dependencies": { "@iarna/toml": "^2.2.5", "@twrangler/schema": "workspace:*" + }, + "devDependencies": { + "dedent": "^1.5.1" } } diff --git a/packages/core/src/index.test.ts b/packages/core/src/index.test.ts index 6e4dcbe..1239594 100644 --- a/packages/core/src/index.test.ts +++ b/packages/core/src/index.test.ts @@ -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); @@ -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" + `); }); }); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6c2b62c..1ca993c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -67,6 +67,10 @@ importers: '@twrangler/schema': specifier: workspace:* version: link:../schema + devDependencies: + dedent: + specifier: ^1.5.1 + version: 1.5.1 packages/schema: dependencies: @@ -1369,6 +1373,15 @@ packages: engines: {node: '>=0.10.0'} dev: true + /dedent@1.5.1: + resolution: {integrity: sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==} + peerDependencies: + babel-plugin-macros: ^3.1.0 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + dev: true + /deep-eql@4.1.3: resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} engines: {node: '>=6'}