@gasket/plugin-jest
Advanced tools
Comparing version 7.2.0-canary.20 to 7.2.0
@@ -1,2 +0,2 @@ | ||
const nextJest = require('next/jest'); | ||
import nextJest from 'next/jest.js'; | ||
const pathToApp = 'pages'; | ||
@@ -13,2 +13,2 @@ const createJestConfig = nextJest(pathToApp); | ||
module.exports = createJestConfig(customJestConfig); | ||
export default createJestConfig(customJestConfig); |
@@ -0,7 +1,8 @@ | ||
import type { Plugin } from '@gasket/core'; | ||
export default { | ||
const plugin: Plugin = { | ||
name: '@gasket/plugin-jest', | ||
version: '', | ||
description: '', | ||
hooks: {} | ||
}; | ||
export = plugin; |
/// <reference types="@gasket/core" /> | ||
/// <reference types="create-gasket-app" /> | ||
/// <reference types="@gasket/plugin-metadata" /> | ||
/// <reference types="@gasket/plugin-express" /> | ||
@@ -23,3 +24,4 @@ const { | ||
}, | ||
handler: async function create(gasket, { files, pkg }) { | ||
handler: async function create(gasket, context) { | ||
const { files, pkg, typescript, apiApp } = context; | ||
const generatorDir = `${__dirname}/../generator`; | ||
@@ -32,3 +34,3 @@ const isReactProject = pkg.has('dependencies', 'react'); | ||
if (isReactProject) { | ||
if (isReactProject && !apiApp) { | ||
files.add( | ||
@@ -44,9 +46,39 @@ `${generatorDir}/*`, | ||
}); | ||
pkg.add('scripts', { | ||
'test': 'jest', | ||
'test:watch': 'jest --watchAll', | ||
'test:coverage': 'jest --coverage' | ||
}); | ||
} else if (apiApp) { | ||
if (typescript) { | ||
pkg.add('devDependencies', { | ||
'@types/jest': devDependencies['@types/jest'], | ||
'cross-env': devDependencies['cross-env'], | ||
'ts-jest': devDependencies['ts-jest'], | ||
'ts-node': devDependencies['ts-node'] | ||
}); | ||
pkg.add('scripts', { | ||
'test': "cross-env NODE_OPTIONS='--unhandled-rejections=strict --experimental-vm-modules' jest", | ||
'test:watch': 'npm run test -- --watchAll', | ||
'test:coverage': 'npm run test -- --coverage' | ||
}); | ||
} else { | ||
pkg.add('devDependencies', { | ||
'cross-env': devDependencies['cross-env'] | ||
}); | ||
pkg.add('scripts', { | ||
'test': "cross-env NODE_OPTIONS='--unhandled-rejections=strict --experimental-vm-modules' jest", | ||
'test:watch': 'npm run test -- --watch', | ||
'test:coverage': 'npm run test -- --coverage' | ||
}); | ||
} | ||
} else { | ||
pkg.add('scripts', { | ||
'test': 'jest', | ||
'test:watch': 'jest --watchAll', | ||
'test:coverage': 'jest --coverage' | ||
}); | ||
} | ||
pkg.add('scripts', { | ||
'test': 'jest', | ||
'test:watch': 'jest --watchAll', | ||
'test:coverage': 'jest --coverage' | ||
}); | ||
} | ||
@@ -53,0 +85,0 @@ }, |
{ | ||
"name": "@gasket/plugin-jest", | ||
"version": "7.2.0-canary.20", | ||
"version": "7.2.0", | ||
"description": "Integrated jest into your application.", | ||
@@ -34,6 +34,2 @@ "main": "lib/index.js", | ||
"author": "GoDaddy Operating Company, LLC", | ||
"maintainers": [ | ||
"Salil Agrawal <sagrawal@godaddy.com>", | ||
"Andrew Gerard <agerard@godaddy.com>" | ||
], | ||
"license": "MIT", | ||
@@ -51,8 +47,8 @@ "bugs": { | ||
"eslint": "^8.56.0", | ||
"eslint-config-godaddy": "^7.1.0", | ||
"eslint-plugin-jest": "^27.6.3", | ||
"eslint-config-godaddy": "^7.1.1", | ||
"eslint-plugin-jest": "^28.6.0", | ||
"eslint-plugin-json": "^3.1.0", | ||
"eslint-plugin-jsx-a11y": "^6.8.0", | ||
"eslint-plugin-react": "^7.33.2", | ||
"eslint-plugin-unicorn": "^44.0.0", | ||
"eslint-plugin-react": "^7.35.0", | ||
"eslint-plugin-unicorn": "^55.0.0", | ||
"jest": "^29.7.0", | ||
@@ -63,2 +59,4 @@ "jest-environment-jsdom": "^29.7.0", | ||
"react-dom": "^18.2.0", | ||
"ts-jest": "^29.2.5", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.4.5" | ||
@@ -80,3 +78,3 @@ }, | ||
}, | ||
"gitHead": "abdb788c7ff44f4c6db7a5885e96e2dd315273fc" | ||
"gitHead": "8790fd065f4bcb853fc9a2deecf0833999f41443" | ||
} |
@@ -8,8 +8,4 @@ # @gasket/plugin-jest | ||
This plugin should only be used during the create command for new apps. | ||
This plugin is only used by presets for `create-gasket-app` and is not installed for apps. | ||
``` | ||
gasket create <app-name> --plugins @gasket/plugin-jest | ||
``` | ||
## Usage | ||
@@ -35,2 +31,1 @@ | ||
[MIT](./LICENSE.md) | ||
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7568
108
0
20
30