feat: upgrade to jest 24 (#4868)

This commit is contained in:
Xin Du (Clark) 2019-02-12 13:05:37 +00:00 committed by GitHub
parent 8678d0d6ab
commit 90ba0cd6b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 492 additions and 820 deletions

4
.gitignore vendored
View File

@ -54,7 +54,3 @@ coverage
Network Trash Folder Network Trash Folder
Temporary Items Temporary Items
.apdisk .apdisk
# Junit report from jest-junit
*junit.xml

View File

@ -20,15 +20,9 @@ steps:
displayName: 'Install dependencies' displayName: 'Install dependencies'
- script: | - script: |
set JEST_JUNIT_OUTPUT=test-fixtures-junit.xml && set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:fixtures -i set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:fixtures -i
displayName: 'Test: Build Fixtures' displayName: 'Test: Build Fixtures'
- script: | - script: |
set JEST_JUNIT_OUTPUT=test-unit-junit.xml && set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:unit -w=2 set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:unit -w=2
displayName: 'Test: Run unit tests' displayName: 'Test: Run unit tests'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'test-*.xml'
displayName: 'Publish test results to Azure Pipelines'

View File

@ -14,9 +14,8 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.1.2", "@babel/core": "^7.1.2",
"@vue/test-utils": "^1.0.0-beta.25", "@vue/test-utils": "^1.0.0-beta.25",
"babel-core": "^7.0.0-bridge.0", "babel-jest": "^24.0.0",
"babel-jest": "^23.6.0", "jest": "^24.0.0",
"jest": "^23.6.0",
"jest-serializer-vue": "^2.0.2", "jest-serializer-vue": "^2.0.2",
"vue-jest": "^3.0.2" "vue-jest": "^3.0.2"
}, },

View File

@ -9,8 +9,7 @@ module.exports = {
// But its performance overhead is pretty bad (30+%). // But its performance overhead is pretty bad (30+%).
// detectOpenHandles: true // detectOpenHandles: true
// setupFilesAfterEnv: ['./test/utils/setup'], setupFilesAfterEnv: ['./test/utils/setup'],
setupTestFrameworkScriptFile: './test/utils/setup',
coverageDirectory: './coverage', coverageDirectory: './coverage',
@ -36,16 +35,12 @@ module.exports = {
transform: { transform: {
'^.+\\.ts$': 'ts-jest', '^.+\\.ts$': 'ts-jest',
'^.+\\.js$': 'babel-jest', '^.+\\.js$': 'babel-jest',
'.*\\.(vue)$': 'vue-jest' '^.+\\.vue$': 'vue-jest'
}, },
moduleFileExtensions: [ moduleFileExtensions: [
'ts', 'ts',
'js', 'js',
'json' 'json'
], ]
reporters: [
'default'
].concat(process.env.JEST_JUNIT_OUTPUT ? ['jest-junit'] : [])
} }

View File

@ -30,9 +30,8 @@
"@nuxtjs/eslint-config": "^0.0.1", "@nuxtjs/eslint-config": "^0.0.1",
"@vue/server-test-utils": "^1.0.0-beta.29", "@vue/server-test-utils": "^1.0.0-beta.29",
"@vue/test-utils": "^1.0.0-beta.29", "@vue/test-utils": "^1.0.0-beta.29",
"babel-core": "^7.0.0-bridge",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0", "babel-jest": "^24.1.0",
"babel-plugin-dynamic-import-node": "^2.2.0", "babel-plugin-dynamic-import-node": "^2.2.0",
"cheerio": "^1.0.0-rc.2", "cheerio": "^1.0.0-rc.2",
"codecov": "^3.1.0", "codecov": "^3.1.0",
@ -56,8 +55,7 @@
"get-port": "^4.1.0", "get-port": "^4.1.0",
"glob": "^7.1.3", "glob": "^7.1.3",
"is-wsl": "^1.1.0", "is-wsl": "^1.1.0",
"jest": "^23.6.0", "jest": "^24.1.0",
"jest-junit": "^6.2.1",
"jsdom": "^13.2.0", "jsdom": "^13.2.0",
"klaw-sync": "^6.0.0", "klaw-sync": "^6.0.0",
"lerna": "3.11.1", "lerna": "3.11.1",
@ -82,7 +80,7 @@
"ts-loader": "^5.3.3", "ts-loader": "^5.3.3",
"tslint": "^5.12.1", "tslint": "^5.12.1",
"typescript": "^3.3.3", "typescript": "^3.3.3",
"vue-jest": "^3.0.3", "vue-jest": "^4.0.0-0",
"vue-property-decorator": "^7.3.0" "vue-property-decorator": "^7.3.0"
}, },
"repository": { "repository": {

View File

@ -1,11 +1,9 @@
import { loadFixture, Nuxt } from '../utils' import { loadFixture, Nuxt } from '../utils'
let nuxt = null
describe.posix('basic sockets', () => { describe.posix('basic sockets', () => {
test('/', async () => { test('/', async () => {
const options = await loadFixture('sockets') const options = await loadFixture('sockets')
nuxt = new Nuxt(options) const nuxt = new Nuxt(options)
await nuxt.server.listen() await nuxt.server.listen()
const { html } = await nuxt.server.renderRoute('/') const { html } = await nuxt.server.renderRoute('/')

1270
yarn.lock

File diff suppressed because it is too large Load Diff