Skip to content

Commit

Permalink
jest => vitest convert
Browse files Browse the repository at this point in the history
  • Loading branch information
arietrouw committed Oct 11, 2024
1 parent a38a4fc commit 68f837f
Show file tree
Hide file tree
Showing 32 changed files with 1,636 additions and 2,777 deletions.
894 changes: 0 additions & 894 deletions .yarn/releases/yarn-4.3.1.cjs

This file was deleted.

925 changes: 925 additions & 0 deletions .yarn/releases/yarn-4.5.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
spec: "https://mskelton.dev/yarn-outdated/v3"

yarnPath: .yarn/releases/yarn-4.3.1.cjs
yarnPath: .yarn/releases/yarn-4.5.0.cjs
10 changes: 2 additions & 8 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
import { config as xylabsConfig } from '@xylabs/eslint-config-flat'

export default [
{
ignores: ['.yarn/**', 'jest.config.cjs', '**/dist/**', 'dist', 'build/**', 'node_modules/**', 'eslint.config.mjs'],
},
{ ignores: ['.yarn/**', '**/dist/**', 'dist', 'build/**', 'node_modules/**', '**/node_modules/**'] },
...xylabsConfig,
{
rules: {
'unicorn/no-process-exit': ['off'],
},
},
{ rules: { 'unicorn/no-process-exit': ['off'] } },
]
25 changes: 0 additions & 25 deletions jest.config.cjs

This file was deleted.

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,22 @@
"@xylabs/ts-scripts-yarn3": "workspace:^"
},
"devDependencies": {
"@types/jest": "^29.5.13",
"@types/json-schema": "^7.0.15",
"@types/node": "^22.7.5",
"@xylabs/eslint-config-flat": "workspace:^",
"@xylabs/ts-scripts-yarn3": "workspace:^",
"@xylabs/tsconfig": "workspace:^",
"dotenv": "^16.4.5",
"eslint": "^9.12.0",
"eslint-import-resolver-typescript": "^3.6.3",
"jest": "^29.7.0",
"jest-extended": "^4.0.2",
"jest-sorted": "^1.0.15",
"rimraf": "^6.0.1",
"typescript": "^5.6.2"
"typescript": "^5.6.2",
"vitest": "^2.1.2"
},
"peerDependencies": {
"typescript": "^5"
},
"packageManager": "yarn@4.3.1",
"packageManager": "yarn@4.5.0",
"engines": {
"node": ">=20.16"
},
Expand Down
7 changes: 2 additions & 5 deletions packages/ts-scripts-yarn3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,11 @@
"cosmiconfig": "^9.0.0",
"cosmiconfig-typescript-loader": "^5.0.0",
"cpy": "^11.1.0",
"deepmerge": "^4.3.1",
"depcheck": "^1.4.7",
"esbuild": "^0.24.0",
"eslint": "^9.12.0",
"glob": "^11.0.0",
"jest": "^29.7.0",
"jest-extended": "^4.0.2",
"jest-mock-extended": "^4.0.0-beta1",
"jest-sorted": "^1.0.15",
"jsonc-eslint-parser": "^2.4.0",
"license-checker": "^25.0.1",
"node-cmd": "^5.0.0",
Expand All @@ -123,14 +120,14 @@
"rollup-plugin-node-externals": "^7.1.3",
"sort-package-json": "^2.10.1",
"supertest": "^7.0.0",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"ts-prune": "^0.10.3",
"tsc-prog": "^2.3.0",
"tslib": "^2.7.0",
"tsup": "^8.3.0",
"typedoc": "^0.26.8",
"types-package-json": "^2.0.39",
"vitest": "^2.1.2",
"yargs": "^17.7.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@xylabs/tsconfig-jest"
"extends": "@xylabs/tsconfig"
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { yarnWorkspace } from '../../../src'
import {
describe, expect, it,
} from 'vitest'

import { yarnWorkspace } from '../../../src/index.ts'

describe('yarnWorkspace', () => {
describe('when workspace', () => {
describe('exists', () => {
it('returns the workspace', () => {
const workspace = yarnWorkspace('@xylabs/ts-scripts-yarn3')
expect(workspace.name).toBeString()
expect(workspace.location).toBeString()
expect(workspace.name).toBeTypeOf('string')
expect(workspace.location).toBeTypeOf('string')
})
})
describe('does not exist', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { yarnWorkspaces } from '../../../src'
import {
describe, expect, it,
} from 'vitest'

import { yarnWorkspaces } from '../../../src/index.ts'

describe('yarnWorkspaces', () => {
it('returns the workspace', () => {
const workspaces = yarnWorkspaces()
expect(workspaces).toBeArray()
expect(Array.isArray(workspaces)).toBeTruthy()
expect(workspaces.length).toBeGreaterThan(0)
for (const workspace of workspaces) {
expect(workspace.name).toBeString()
expect(workspace.location).toBeString()
expect(workspace.name).toBeTypeOf('string')
expect(workspace.location).toBeTypeOf('string')
}
})
})
1 change: 0 additions & 1 deletion packages/ts-scripts-yarn3/src/actions/package/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const defaultIgnoreDevDeps = [
'@xylabs/tsconfig',
'@xylabs/tsconfig-dom',
'@xylabs/tsconfig-react',
'@xylabs/tsconfig-jest',
'typescript',
]
const defaultIgnoreDevPatterns = ['*.stories.*', '*.spec.*', 'spec', 'stories', 'tsconfig.json']
Expand Down
2 changes: 1 addition & 1 deletion packages/ts-scripts-yarn3/src/actions/test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { runSteps } from '../lib/index.ts'

export const test = () => {
return runSteps('Test', [['yarn', ['jest', '.']]])
return runSteps('Test', [['yarn', ['vitest', '.']]])
}
3 changes: 1 addition & 2 deletions packages/ts-scripts-yarn3/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"exclude": ["dist"],
"extends": "@xylabs/tsconfig",
"include": ["src"]
"extends": "@xylabs/tsconfig"
}
3 changes: 0 additions & 3 deletions packages/tsconfig-dom-jest/.depcheckrc

This file was deleted.

15 changes: 0 additions & 15 deletions packages/tsconfig-dom-jest/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions packages/tsconfig-dom-jest/.npmignore

This file was deleted.

48 changes: 0 additions & 48 deletions packages/tsconfig-dom-jest/package.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/tsconfig-dom-jest/src/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/tsconfig-dom-jest/tsconfig.json

This file was deleted.

10 changes: 0 additions & 10 deletions packages/tsconfig-dom-jest/xy.config.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/tsconfig-jest/.depcheckrc

This file was deleted.

15 changes: 0 additions & 15 deletions packages/tsconfig-jest/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions packages/tsconfig-jest/.npmignore

This file was deleted.

52 changes: 0 additions & 52 deletions packages/tsconfig-jest/package.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/tsconfig-jest/src/index.ts

This file was deleted.

Loading

0 comments on commit 68f837f

Please sign in to comment.