Skip to content

Commit

Permalink
testing code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAlbin committed Apr 15, 2024
1 parent 34f0208 commit 80a54dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
3 changes: 2 additions & 1 deletion packages/next-drupal/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
preset: "ts-jest/presets/default-esm",
testEnvironment: "node",
setupFiles: ["dotenv/config"],
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
Expand All @@ -10,6 +10,7 @@ module.exports = {
"ts-jest",
{
isolatedModules: true,
useESM: true,
},
],
},
Expand Down
22 changes: 10 additions & 12 deletions packages/next-drupal/tests/NextDrupalBase/constructor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@ describe("baseUrl parameter", () => {
process.env = env
})

test("throws error given an invalid baseUrl", () => {
expect(
() =>
// @ts-expect-error
new NextDrupalBase()
).toThrow("The 'baseUrl' param is required.")

expect(
() =>
// @ts-expect-error
new NextDrupalBase({})
).toThrow("The 'baseUrl' param is required.")
test("throws error given an invalid baseUrl", async () => {
expect(() => {
// @ts-expect-error
new NextDrupalBase()
}).toThrow("The 'baseUrl' param is required.")

expect(() => {
// @ts-expect-error
new NextDrupalBase({})
}).toThrow("The 'baseUrl' param is required.")
})

test("announces debug mode when turned on", () => {
Expand Down

0 comments on commit 80a54dc

Please sign in to comment.