Skip to content

Commit

Permalink
fix: add back Node 12 support (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored and mihar-22 committed Sep 21, 2021
1 parent 38961d6 commit e5de1c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14, 16]
node-version: [12, 14, 16]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
Expand Down
4 changes: 2 additions & 2 deletions src/transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const dynamicImport = async (filename) => import(pathToFileURL(filename))
* Jest will only call this method when running in ESM mode.
*/
const processAsync = async (source, filename, jestOptions) => {
const options = jestOptions?.transformerConfig ?? {}
const options = jestOptions && jestOptions.transformerConfig ? jestOptions.transformerConfig : {}
const { preprocess, rootMode } = options

if (!preprocess) {
Expand All @@ -34,7 +34,7 @@ const processAsync = async (source, filename, jestOptions) => {
* However, Jest calls this method in CJS mode.
*/
const processSync = (source, filename, jestOptions) => {
const options = jestOptions?.transformerConfig ?? {}
const options = jestOptions && jestOptions.transformerConfig ? jestOptions.transformerConfig : {}
const { preprocess, rootMode, maxBuffer, showConsoleLog } = options
if (!preprocess) {
return compiler('cjs', options, filename, source)
Expand Down

0 comments on commit e5de1c6

Please sign in to comment.