Skip to content

Commit

Permalink
Merge pull request #6 from jitbug/jest29
Browse files Browse the repository at this point in the history
Jest v29. Release jitbug/helpers v3.0.0
  • Loading branch information
junelau authored Oct 10, 2024
2 parents 98fb2bd + 814a8f6 commit d5966cd
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node.js 12.x
- name: Use Node.js 20.x
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 20

- run: npm install

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node.js 12.x
- name: Use Node.js 20.x
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 20
registry-url: https://registry.npmjs.org

- run: npm install
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [3.0.0](https://github.com/jitbug/helpers/compare/v2.7.1...v3.0.0) (2024-10-10)

## [2.7.1](https://github.com/jitbug/helpers/compare/v2.7.0...v2.7.1) (2021-04-23)

### Features
Expand Down
4 changes: 0 additions & 4 deletions jest-setup-file.cjs → jest-setup-file.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
const fetch = require('node-fetch');

global.fetch = fetch;

/**
* This file is referenced as a testing setup file for Jest. It runs once per test file immediately before executing the test.
*
Expand Down
6 changes: 0 additions & 6 deletions jest.config.cjs

This file was deleted.

13 changes: 13 additions & 0 deletions jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// jest.config.mjs
// import { defaults } from 'ts-jest/presets';

export default {
roots: ['<rootDir>/src'],
setupFilesAfterEnv: ['<rootDir>/jest-setup-file.mjs'],
preset: 'ts-jest/presets/default-esm', // Ensure you're using the ESM preset for TypeScript
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts', '.tsx'], // Treat TypeScript files as ESM
transform: {
'^.+\\.tsx?$': 'ts-jest', // Use ts-jest for TypeScript files
},
};
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jitbug/helpers",
"version": "2.7.1",
"version": "3.0.0",
"description": "Helpers for Jitbug's Ionic + Stencil PWAs.",
"type": "module",
"module": "index.js",
Expand Down Expand Up @@ -33,12 +33,10 @@
"@ionic/core": "^6.7.5",
"@types/jest": "29.5.13",
"@types/node": "22.7.5",
"@types/node-fetch": "2.6.11",
"@types/nprogress": "0.2.3",
"jest": "29.7.0",
"moment": "2.30.1",
"moment-timezone": "0.5.46",
"node-fetch": "3.3.2",
"nprogress": "0.2.0",
"prettier": "2.2.1",
"prettier-plugin-organize-imports": "4.1.0",
Expand Down
7 changes: 5 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"esModuleInterop": true,
"lib": ["dom", "es2017"],
"module": "esnext",
"target": "es2017",
"target": "esnext",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
Expand All @@ -19,6 +19,9 @@
"rootDir": "src",
"baseUrl": "."
},
"ts-jest": {
"useESM": true
},
"include": ["src"],
"exclude": []
}
}

0 comments on commit d5966cd

Please sign in to comment.