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 177c4a7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/next-drupal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
- name: Install packages
run: yarn
- name: Run tests
run: yarn test
run: |
yarn jest --clearCache
yarn test
env:
DRUPAL_BASE_URL: ${{ secrets.DRUPAL_BASE_URL }}
DRUPAL_USERNAME: ${{ secrets.DRUPAL_USERNAME }}
Expand Down
4 changes: 3 additions & 1 deletion packages/next-drupal/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
preset: "ts-jest/presets/default-esm",
extensionsToTreatAsEsm: [".ts"],
testEnvironment: "node",
setupFiles: ["dotenv/config"],
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
Expand All @@ -10,6 +11,7 @@ module.exports = {
"ts-jest",
{
isolatedModules: true,
useESM: true,
},
],
},
Expand Down
4 changes: 3 additions & 1 deletion packages/next-drupal/src/next-drupal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,9 @@ export class NextDrupal extends NextDrupalBase {
}

deserialize(body, options?) {
if (!body) return null
if (!body) {
return null
}

return this.deserializer(body, options)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe("baseUrl parameter", () => {
process.env = env
})

test("throws error given an invalid baseUrl", () => {
test("throws error given an invalid baseUrl", async () => {
expect(
() =>
// @ts-expect-error
Expand Down

0 comments on commit 177c4a7

Please sign in to comment.