Skip to content

Commit

Permalink
chore: added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Moreno committed May 8, 2021
1 parent 25e9b64 commit 4cb383b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: esbuild-jest

on: [push]
on: [push, pull_request]

jobs:
ubuntu-latest:
Expand All @@ -19,6 +19,7 @@ jobs:
- run: yarn
- run: yarn build
- run: yarn test
- run: yarn test:coverage
env:
CI: true
windows-latest:
Expand All @@ -37,6 +38,7 @@ jobs:
- run: yarn
- run: yarn build
- run: yarn test
- run: yarn test:coverage
env:
CI: true
macos-latest:
Expand All @@ -55,5 +57,6 @@ jobs:
- run: yarn
- run: yarn build
- run: yarn test
- run: yarn test:coverage
env:
CI: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist
.envrc
default.nix
default.nix
coverage
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"scripts": {
"postinstall": "yarn build",
"build": "ts-node ./tools/build.ts",
"test": "jest --clearCache && jest --detectOpenHandles"
"test": "jest --clearCache && jest --detectOpenHandles",
"test:coverage": "jest --clearCache && jest --coverage"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const createTransformer = (options?: Options) => ({
const ext = getExt(filename), extName = extname(filename).slice(1)

// Caution: disabling this, can cause issues with inlineSnapshots since can't find the original line
const enableSourcemaps = options?.sourcemap || true
const enableSourcemaps = options?.sourcemap === false ? false : (options?.sourcemap || true)
const loader = (options?.loaders && options?.loaders[ext]
? options.loaders[ext]
: loaders.includes(extName) ? extName: 'text'
Expand Down

0 comments on commit 4cb383b

Please sign in to comment.