Skip to content

Commit

Permalink
chore: ts-jest save off
Browse files Browse the repository at this point in the history
  • Loading branch information
nmccready committed Sep 12, 2024
1 parent 9f1ea53 commit 2a50d49
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 144 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
submodules
node_modules
node_modules/**/*.js
dist
lib
!.storybook
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
useTabs: false,
printWidth: 95,
tabWidth: 2,
singleQuote: true,
trailingComma: 'es5',
arrowParens: 'always',
};
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

32 changes: 32 additions & 0 deletions _jest.config.no
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// jest.config.ts
import { createDefaultPreset, JestConfigWithTsJest } from 'ts-jest'

const jestConfig: JestConfigWithTsJest = {
// [...]
...createDefaultPreset(),
}
// const toNotIgnore = {
// modules: [].join('|'),
// };

// const toExport = {
// roots: ['<rootDir>'],
// // moduleFileExtensions: ['js', 'css', 'ts'],
// transformIgnorePatterns: ['node_modules', '/<rootDir>/lib', '/<rootDir>/(?!src)'],
// verbose: true,
// collectCoverageFrom: [
// 'src/**/*.{ts,js}',
// '!<rootDir>/node_modules/',
// '!<rootDir>/lib/',
// '!<rootDir>/umd/',
// '!<rootDir>/config/',
// '!<rootDir>/test/',
// ],
// testRegex: '(/test/.*(test|spec))\\.[jt]sx?$',
// };

// if (toNotIgnore.modules.length) {
// toExport.transformIgnorePatterns.push(`/node_modules/(?!(${toNotIgnore.modules}))`);
// }

// module.exports = toExport;
51 changes: 0 additions & 51 deletions gulpfile.ts

This file was deleted.

36 changes: 6 additions & 30 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,8 @@
const toNotIgnore = {
modules: [].join('|'),
};

const toExport = {
roots: ['<rootDir>'],
// moduleFileExtensions: ['js', 'css', 'ts'],
transformIgnorePatterns: ['node_modules', '/<rootDir>/lib', '/<rootDir>/(?!src)'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/node_modules/@znemz/react-extras-jest/lib/assetsTransformer.js',
'\\.(css|less|pcss)(!js)$':
'<rootDir>/node_modules/@znemz/react-extras-jest/lib/assetsTransformer.js',
/** @type {import('ts-jest').JestConfigWithTsJest} * */
module.exports = {
testEnvironment: 'node',
transform: {
'^.+.tsx?$': ['ts-jest', {}],
},
setupFilesAfterEnv: ['<rootDir>/node_modules/@znemz/react-extras-jest/lib/setup.js'],
verbose: true,
collectCoverageFrom: [
'src/**/*.{ts,js}',
'!<rootDir>/node_modules/',
'!<rootDir>/lib/',
'!<rootDir>/umd/',
'!<rootDir>/config/',
'!<rootDir>/test/',
],
testRegex: '(/test/.*(test|spec))\\.[jt]sx?$',
testMatch: ['**/?(*.)+(spec|test).[tj]s?(x)'],
};

if (toNotIgnore.modules.length) {
toExport.transformIgnorePatterns.push(`/node_modules/(?!(${toNotIgnore.modules}))`);
}

module.exports = toExport;
27 changes: 12 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
"umd"
],
"scripts": {
"build": "npm run gulp default && npm run roll:it",
"build": "npx tsc",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"docs:api:markdown": "npx typedoc --theme markdown --exclude ./src/test --out ./docs/api ./src",
"docs:api:website": "npx typedoc --exclude ./src/test --out docs ./src",
"gulp": "node -r esm ./node_modules/.bin/gulp",
"jest": "node -r esm ./node_modules/.bin/jest",
"jest": "npx ts-jest",
"lint": "eslint --ext .js,.ts,.tsx *.js src test --color",
"mocha": "mocha",
"prepare": "npx sort-package-json",
Expand All @@ -45,31 +44,29 @@
"@commitlint/cli": "^19",
"@commitlint/config-conventional": "^19",
"@types/debug": "^4",
"@znemz/js-common-babel-config": "^0.2.1",
"@types/jest": "^29.5.13",
"@znemz/js-common-eslint-config": "^0.2.2",
"@znemz/react-extras-jest": "^1.1.0",
"JSONStream": "1.X",
"bluebird": "^3.5.5",
"commitlint": "19",
"config": "^3.2.2",
"coveralls": "^3.0.4",
"del": "^4.1.1",
"esm": "^3.2.22",
"gulp": "^4.0.2",
"gulp-run": "^1.7.1",
"gulp-typescript": "^5.0.1",
"hook-std": "0.X",
"jest": "^29.7.0",
"jest-extended": "^0.11.5",
"JSONStream": "1.X",
"prettier": "^1.18.2",
"react": "^16.8",
"rollup": "^1.20.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-typescript": "^1.0.1",
"sort-package-json": "^2.10.1",
"typedoc": "~0.15.0",
"typedoc-plugin-markdown": "~2.1.4",
"typescript": "~4.4"
"ts-jest": "^29.2.5",
"typedoc": "0.26.7",
"typedoc-plugin-markdown": "^4.2.7",
"typescript": "^4.2.4"
},
"engines": {
"node": ">= 8"
"node": ">= 14"
},
"umd": "umd/index.js"
}
18 changes: 0 additions & 18 deletions rollup.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"emitDecoratorMetadata": true,
"noImplicitAny": false,
"module": "commonjs",
"target": "ES5",
"target": "ES2020",
"experimentalDecorators": true,
"sourceMap": false,
"declaration": true,
Expand Down

0 comments on commit 2a50d49

Please sign in to comment.