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

Migrate Codegen OpenAPI's unit tests to Vitest #4137

Merged
merged 47 commits into from
Feb 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f52e48d
Change jest config to vitest
aryaemami59 Jan 29, 2024
6bf4f75
Change jest to vitest
aryaemami59 Jan 29, 2024
d631545
Fix `test` command
aryaemami59 Jan 29, 2024
ffa04f0
Fix `tsconfig.json`
aryaemami59 Jan 29, 2024
eb77694
Rename `jest.setup.ts` to `vitest.setup.ts`
aryaemami59 Jan 29, 2024
e92edaa
Fix `setupFiles` in `vitest.config.mts`
aryaemami59 Jan 29, 2024
e6f14ec
Bump `msw`
aryaemami59 Jan 29, 2024
1435e48
Update msw code snippets with v2 syntax
aryaemami59 Jan 29, 2024
739e37c
Remove `babel.config.js`
aryaemami59 Jan 29, 2024
444bb61
Disable worker threads to make `process.chdir` work
aryaemami59 Jan 29, 2024
a14f901
Update `tsconfig.json`s to make `import.meta.dirname` work
aryaemami59 Jan 29, 2024
7507f80
Drop jest related packages
aryaemami59 Jan 29, 2024
a03c3f8
Fix `tsconfig.json` to exclude `vitest.config.mts` from build
aryaemami59 Jan 29, 2024
29407bd
Add `test:watch` NPM script
aryaemami59 Jan 29, 2024
220c0c2
Fix `test:update` to use `vitest` instead of `jest`
aryaemami59 Jan 29, 2024
b808700
Fix `prepare` command to use `yarn` instead of `npm`
aryaemami59 Jan 29, 2024
a133bad
Add `rimraf` to `devDependencies`
aryaemami59 Jan 29, 2024
6a815e6
Add `clean` NPM script
aryaemami59 Jan 29, 2024
389296a
Fix `vitest.setup.ts`
aryaemami59 Jan 29, 2024
4f982de
Bump `node-fetch`
aryaemami59 Jan 29, 2024
6466cc2
Update snapshots
aryaemami59 Jan 29, 2024
ea195e7
Replace inline `require` with dynamic import
aryaemami59 Jan 29, 2024
32843ff
Manually define `__dirname`
aryaemami59 Jan 29, 2024
9065804
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Jan 29, 2024
71eb9c5
Remove `pool: 'typescript'` in `vitest.config.mts`
aryaemami59 Jan 31, 2024
69a2712
Update snapshots further
aryaemami59 Jan 31, 2024
6c6449a
Skip failing tests for now
aryaemami59 Jan 31, 2024
743cf07
Fix `test:update:enum` NPM script
aryaemami59 Jan 31, 2024
4b7939b
Revert "Fix `test:update:enum` NPM script"
aryaemami59 Jan 31, 2024
a285872
Skip more failing tests
aryaemami59 Jan 31, 2024
1aa707f
Fix default imports
aryaemami59 Jan 31, 2024
d8edc4f
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Feb 3, 2024
8899bee
Re-bump `node-fetch`
aryaemami59 Feb 3, 2024
65fa51e
Update snapshots
aryaemami59 Feb 3, 2024
b255e75
Fix failing tests
aryaemami59 Feb 3, 2024
fe47ae2
Try to make CI happy
aryaemami59 Feb 3, 2024
549a614
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Feb 4, 2024
548dd59
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit int…
aryaemami59 Feb 7, 2024
528d916
Update lockfile
aryaemami59 Feb 7, 2024
04ea106
Try to make CI happy
aryaemami59 Feb 7, 2024
dbe9a8a
Try things
aryaemami59 Feb 7, 2024
22ebf49
Try more things
aryaemami59 Feb 7, 2024
0c5164f
Bump Node
aryaemami59 Feb 7, 2024
cd4514c
Silence failing test for now
aryaemami59 Feb 7, 2024
6d8c918
Revert "Silence failing test for now"
aryaemami59 Feb 7, 2024
d289b24
Fix unit tests
aryaemami59 Feb 7, 2024
66485e3
Change timeout for unit tests
aryaemami59 Feb 7, 2024
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
@@ -192,7 +192,7 @@ export type Pet = {
category?: Category;
photoUrls: string[];
tags?: Tag[];
status?: Status;
status?: 'available' | 'pending' | 'sold';
};
export type ApiResponse = {
code?: number;
@@ -204,7 +204,7 @@ export type Order = {
petId?: number;
quantity?: number;
shipDate?: string;
status?: Status2;
status?: 'placed' | 'approved' | 'delivered';
complete?: boolean;
};
export type User = {
@@ -217,20 +217,10 @@ export type User = {
phone?: string;
userStatus?: number;
};
export enum Status {
Available = 'available',
Pending = 'pending',
Sold = 'sold',
}
export enum Status2 {
Placed = 'placed',
Approved = 'approved',
Delivered = 'delivered',
}
"
`;

exports[`CLI options testing > paths are relative to configfile, not to cwd 1`] = `
exports[`CLI options testing > paths are relative to config file, not to cwd 1`] = `
"import { api } from '../fixtures/emptyApi';
const injectedRtkApi = api.injectEndpoints({
endpoints: (build) => ({
@@ -422,7 +412,7 @@ export type Pet = {
category?: Category;
photoUrls: string[];
tags?: Tag[];
status?: Status;
status?: 'available' | 'pending' | 'sold';
};
export type ApiResponse = {
code?: number;
@@ -434,7 +424,7 @@ export type Order = {
petId?: number;
quantity?: number;
shipDate?: string;
status?: Status2;
status?: 'placed' | 'approved' | 'delivered';
complete?: boolean;
};
export type User = {
@@ -447,15 +437,5 @@ export type User = {
phone?: string;
userStatus?: number;
};
export enum Status {
Available = 'available',
Pending = 'pending',
Sold = 'sold',
}
export enum Status2 {
Placed = 'placed',
Approved = 'approved',
Delivered = 'delivered',
}
"
`;