Skip to content

Commit

Permalink
fix: proper esm support in runner
Browse files Browse the repository at this point in the history
  • Loading branch information
keplersj committed Feb 28, 2022
1 parent 21848b4 commit b19e281
Show file tree
Hide file tree
Showing 13 changed files with 628 additions and 595 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,4 @@ typings/
.dynamodb/

# End of https://www.gitignore.io/api/node
dist
95 changes: 95 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@

# Created by https://www.gitignore.io/api/node
# Edit at https://www.gitignore.io/?templates=node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# End of https://www.gitignore.io/api/node
2 changes: 1 addition & 1 deletion jest-preset.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
runner: "remark",
moduleFileExtensions: ["md", "mdx", "markdown", "mkd", "mkdn", "mkdown"],
testMatch: [
Expand Down
42 changes: 42 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
export default {
collectCoverage: true,
coverageReporters: ["json", "text"],
projects: [
{
preset: "ts-jest/presets/default-esm",
globals: {
"ts-jest": {
useESM: true,
},
},
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
collectCoverage: true,
testPathIgnorePatterns: ["/node_modules/", "/dist/"],
coverageReporters: ["json", "text"],
displayName: "test",
},
{
preset: "./jest-preset.js",
runner: "./dist/index.js",
displayName: "lint:remark",
testPathIgnorePatterns: [
"/node_modules/",
"/dist/",
"/src/__fixtures__/",
],
},
{
preset: "jest-runner-prettier",
displayName: "lint:prettier",
testPathIgnorePatterns: ["/node_modules/", "/dist/", "/coverage/"],
},
{
runner: "eslint",
displayName: "lint:eslint",
testMatch: ["<rootDir>/src/**/*"],
testPathIgnorePatterns: ["/node_modules/", "/dist/", "/coverage/"],
},
],
};
17 changes: 0 additions & 17 deletions jest.config.mjs

This file was deleted.

Loading

0 comments on commit b19e281

Please sign in to comment.