Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve examples folder #4083

Merged
merged 2 commits into from
Apr 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import preset from 'ts-jest/presets/index.js'

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest/presets/js-with-babel-esm',
export default {
...preset.jsWithBabelESM,
transform: {
'^.+\\.tsx?$': [
'^.+\.[tj]sx?$': [
'ts-jest',
{
babelConfig: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import preset from 'ts-jest/presets/index.js'

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest/presets/js-with-babel-esm',
export default {
...preset.jsWithBabelESM,
transform: {
'^.+\\.tsx?$': [
'^.+\.[tj]sx?$': [
'ts-jest',
{
babelConfig: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const preset = require('ts-jest/presets')

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest/presets/js-with-babel',
...preset.jsWithBabel,
transform: {
'^.+\\.tsx?$': [
'^.+\.[tj]sx?$': [
'ts-jest',
{
babelConfig: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest/presets/js-with-babel',
transform: {
'^.+\\.tsx?$': [
'^.+\.[tj]sx?$': [
'ts-jest',
{
babelConfig: true,
Expand Down
16 changes: 8 additions & 8 deletions examples/js-with-babel/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions examples/js-with-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"name": "js-with-babel",
"version": "0.0.0",
"scripts": {
"test": "jest --no-cache",
"test-isolated": "jest -c=jest-isolated.config.js --no-cache",
"test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.js --no-cache",
"test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.js --no-cache"
"test": "jest -c=jest.config.cjs --no-cache",
"test-isolated": "jest -c=jest-isolated.config.cjs --no-cache",
"test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.mjs --no-cache",
"test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.mjs --no-cache"
},
"devDependencies": {
"@babel/core": "^7.21.4",
"@babel/preset-env": "^7.21.4",
"babel-jest": "^29.5.0",
"jest": "^29.5.0",
"ts-jest": "^29.1.0",
"typescript": "~4.9.5"
"typescript": "~5.0.3"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import preset from 'ts-jest/presets/index.js'

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest/presets/js-with-ts-esm',
export default {
...preset.jsWithTsESM,
transform: {
'^.+\\.m?[tj]sx?$': [
'^.+\.[tj]sx?$': [
'ts-jest',
{
isolatedModules: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import preset from 'ts-jest/presets/index.js'

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest/presets/js-with-ts-esm',
export default {
...preset.jsWithTsESM,
transform: {
'^.+\\.m?[tj]sx?$': [
'^.+\.[tj]sx?$': [
'ts-jest',
{
tsconfig: 'tsconfig-esm.json',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const preset = require('ts-jest/presets')

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest/presets/js-with-ts',
...preset.jsWithTs,
transform: {
'^.+\\.[tj]sx?$': [
'^.+\.[tj]sx?$': [
'ts-jest',
{
isolatedModules: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const preset = require('ts-jest/presets')

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest/presets/js-with-ts',
...preset.jsWithTs,
}
16 changes: 8 additions & 8 deletions examples/js-with-ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions examples/js-with-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "js-with-ts",
"version": "0.0.0",
"scripts": {
"test": "jest --no-cache",
"test-isolated": "jest -c=jest-isolated.config.js --no-cache",
"test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.js --no-cache",
"test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.js --no-cache"
"test": "jest -c=jest.config.cjs --no-cache",
"test-isolated": "jest -c=jest-isolated.config.cjs --no-cache",
"test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.mjs --no-cache",
"test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.mjs --no-cache"
},
"devDependencies": {
"jest": "^29.5.0",
"ts-jest": "^29.1.0",
"typescript": "~4.9.5"
"typescript": "~5.0.3"
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const baseEsmCfg = require('./jest-esm.config')
const baseCfg = require('./jest.config')
import baseEsmCfg from './jest-esm.config.mjs'

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
export default {
...baseEsmCfg,
transform: {
...baseCfg.transform,
...baseEsmCfg.transform,
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const baseCfg = require('./jest.config')
import baseCfg from './jest.config.cjs'

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
export default {
...baseCfg,
preset: 'ts-jest/presets/js-with-babel-esm',
transform: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const baseCfg = require('./jest.config')
const baseCfg = require('./jest.config.cjs')

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
Expand Down
36 changes: 18 additions & 18 deletions examples/react-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions examples/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"style-loader": "^3.3.1",
"tailwindcss": "^3.0.2",
"terser-webpack-plugin": "^5.2.5",
"ts-jest": "^29.0.2",
"typescript": "^4.5.5",
"ts-jest": "^29.1.0",
"typescript": "~5.0.3",
"web-vitals": "^2.1.4",
"webpack": "^5.76.0",
"webpack-dev-server": "^4.6.0",
Expand All @@ -65,10 +65,10 @@
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "jest --no-cache",
"test-isolated": "jest -c=jest-isolated.config.js --no-cache",
"test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.js --no-cache",
"test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.js --no-cache"
"test": "jest -c=jest.config.cjs --no-cache",
"test-isolated": "jest -c=jest-isolated.config.cjs --no-cache",
"test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.mjs --no-cache",
"test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.mjs --no-cache"
},
"browserslist": {
"production": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import preset from 'ts-jest/presets/index.js'

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest/presets/default-esm',
export default {
...preset.defaultsESM,
transform: {
'^.+\\.tsx?$': [
'ts-jest',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import preset from 'ts-jest/presets/index.js'

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest/presets/default-esm',
export default {
...preset.defaultsESM,
transform: {
'^.+\\.tsx?$': [
'ts-jest',
Expand Down
Loading