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

Vitest #5013

Closed
wants to merge 30 commits into from
Closed

Vitest #5013

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
17d4520
Bytter fra less til css
hallvardastark Sep 1, 2023
7381523
Renamet alle css-filer, fix storybook
hallvardastark Sep 1, 2023
8a05562
Merge branch 'master' into less-til-css
hallvardastark Sep 5, 2023
8b00c51
endrer jobb fra less til css
hallvardastark Sep 5, 2023
4da20eb
stylelint fix
hallvardastark Sep 5, 2023
82631eb
Merge branch 'master' into less-til-css
thomashwi Sep 5, 2023
df2d855
Bruker tokens for farger der de finnes
hallvardastark Sep 6, 2023
3afd7f9
Fikset pil i prosessmeny
hallvardastark Sep 6, 2023
b27ad00
Linting
hallvardastark Sep 7, 2023
b31dd61
Merge branch 'master' into less-til-css
hallvardastark Sep 8, 2023
ea4aed2
Vitest
hallvardastark Sep 8, 2023
b644e74
Fikser workflow
hallvardastark Sep 8, 2023
0e56253
fix form pakke
hallvardastark Sep 8, 2023
791d105
fjerne console.log
hallvardastark Sep 8, 2023
504f675
fix test
hallvardastark Sep 8, 2023
1eac01d
tester experimentalVmThreads
hallvardastark Sep 8, 2023
41d23b7
fikset flere tester
hallvardastark Sep 8, 2023
ddf0165
Bruker lerna for å kjøre testene
hallvardastark Sep 11, 2023
4e82ca3
Fix test
hallvardastark Sep 11, 2023
5959dcb
prøver å fikse test
hallvardastark Sep 11, 2023
9edd6ad
litt config-endringer
hallvardastark Sep 11, 2023
0da9186
oppdatert lerna config
hallvardastark Sep 11, 2023
1f8694e
Bruker vitest uten lerna
hallvardastark Sep 11, 2023
3b89b9a
nedgraderer pakke
hallvardastark Sep 12, 2023
7f70ebd
forhindrer console log i testkjøring
hallvardastark Sep 12, 2023
4a4d726
Merge branch 'master' into vitest
hallvardastark Oct 2, 2023
28b9af9
Merge branch 'master' into vitest
hallvardastark Oct 3, 2023
5c172ed
Merge branch 'master' into vitest
hallvardastark Oct 5, 2023
755489f
Merge branch 'master' into vitest
hallvardastark Oct 11, 2023
59e06fc
Merge branch 'master' into vitest
hallvardastark Nov 14, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
run: HUSKY=0 yarn install --immutable

- name: Kjører tester
run: yarn test:all --maxWorkers=2 --silent
run: yarn test --silent
8 changes: 7 additions & 1 deletion @types/externals.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
declare module '*.svg';
declare module '*.svg' {
import React = require('react');

export const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>;
const src: string;
export default src;
}
declare module '*.less';
declare module '*.css';
declare module '*.module.css';
1 change: 1 addition & 0 deletions eslint/eslintrc.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const config = {

globals: {
VERSION: 'off',
vi: true,
},

parser: '@typescript-eslint/parser',
Expand Down
14 changes: 0 additions & 14 deletions jest-runner-eslint.config.js

This file was deleted.

34 changes: 0 additions & 34 deletions jest.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"packages": ["packages/*"],
"version": "independent",
"npmClient": "yarn"
"npmClient": "yarn",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
"url": "git+https://github.com/navikt/k9-sak-web.git"
},
"scripts": {
"test": "jest -o --colors",
"test:all": "jest --colors",
"test:all:testonly": "jest --colors --selectProjects test",
"test:watch": "jest --watch --colors --silent=false",
"test:watch:all": "jest --watchAll --colors",
"test:coverage": "jest --coverage --colors --selectProjects test",
"test": "vitest",
"test:all:testonly": "vitest --selectProjects test",
"test:watch": "vitest --watch --silent=false",
"test:watch:all": "vitest --watchAll",
"test:coverage": "vitest --coverage --selectProjects test",
"ts-check": "tsc --pretty",
"lint": "eslint --cache packages --ext .ts,.tsx,.js,.jsx",
"lint:fix": "eslint --fix --cache packages --ext .ts,.tsx,.js,.jsx",
Expand All @@ -35,7 +34,7 @@
"storybook": "storybook dev -p 9001",
"deploy-storybook": "storybook build -o .static_storybook && storybook-to-ghpages --existing-output-dir=.static_storybook",
"prepare": "husky install",
"sentry-release": "(SENTRY_RELEASE=$(git rev-parse --short HEAD); node ./scripts/sentry-release)"
"sentry-release": "(export SENTRY_RELEASE=$(git rev-parse --short HEAD); node ./scripts/sentry-release)"
},
"workspaces": [
"packages/*"
Expand Down Expand Up @@ -95,7 +94,7 @@
"@storybook/theming": "7.5.3",
"@svgr/webpack": "8.1.0",
"@testing-library/dom": "8.20.1",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "12.1.5",
"@testing-library/user-event": "13.5.0",
"@types/chai": "4.3.9",
Expand All @@ -110,6 +109,7 @@
"@types/sinon": "10.0.20",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"@vitejs/plugin-react": "^4.0.4",
"@wojtekmaj/enzyme-adapter-react-17": "0.8.0",
"autoprefixer": "^10.4.16",
"axios-mock-adapter": "1.22.0",
Expand Down Expand Up @@ -138,6 +138,7 @@
"eslint-plugin-storybook": "0.6.15",
"external-remotes-plugin": "1.0.0",
"file-loader": "6.2.0",
"happy-dom": "^11.0.2",
"html-webpack-plugin": "5.5.3",
"husky": "8.0.3",
"identity-obj-proxy": "3.0.0",
Expand Down Expand Up @@ -170,6 +171,9 @@
"terser-webpack-plugin": "5.3.9",
"thread-loader": "4.0.2",
"typescript": "5.2.2",
"vite": "^4.4.9",
"vite-plugin-svgr": "^3.2.0",
"vitest": "^0.34.3",
"webpack": "5.89.0",
"webpack-cli": "5.1.4",
"webpack-dev-server": "4.15.1",
Expand Down
1 change: 1 addition & 0 deletions packages/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import FastBreddeAligner from './FastBreddeAligner';

it('renders all columns with given content', () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/fakta-bosted-soker/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "@fpsak-frontend/fakta-bosted-soker",
"version": "1.0.0",
"module": "index.jsx",
"main": "index.ts",
"module": "index.ts",
"license": "MIT",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/fakta-feilutbetaling/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fpsak-frontend/fakta-feilutbetaling",
"version": "1.0.0",
"module": "index.jsx",
"module": "index.ts",
"license": "MIT",
"private": true,
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/fakta-felles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@k9-sak-web/fakta-felles",
"version": "1.0.0",
"main": "index.ts",
"module": "index.ts",
"license": "MIT",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/fakta-inntekt-og-ytelser/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fpsak-frontend/fakta-inntekt-og-ytelser",
"version": "1.0.0",
"module": "index.jsx",
"module": "index.ts",
"license": "MIT",
"private": true,
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { InstitusjonVurderingMedPerioder, Vurderingsresultat } from '@k9-sak-web
import { Calender } from '@navikt/ds-icons';
import { AssessedBy, Box, DetailView, LabelledContent, LinkButton, Margin } from '@navikt/ft-plattform-komponenter';
import React from 'react';
import styles from './institusjonFerdigVisning.modules.css';
import styles from './institusjonFerdigVisning.module.css';

interface OwnProps {
vurdering: InstitusjonVurderingMedPerioder;
Expand Down
2 changes: 1 addition & 1 deletion packages/fakta-institusjon/src/InstitusjonNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { InstitusjonPerioderMedResultat } from '@k9-sak-web/types';
import { Heading } from '@navikt/ds-react';
import { InteractiveList } from '@navikt/ft-plattform-komponenter';
import React, { useEffect } from 'react';
import styles from './InstitusjonNavigation.modules.css';
import styles from './InstitusjonNavigation.module.css';
import PeriodeRad from './PeriodeRad';
import institusjonStatus from './konstanter';

Expand Down
2 changes: 1 addition & 1 deletion packages/fakta-institusjon/src/PeriodeRad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@navikt/ft-plattform-komponenter';
import { Period } from '@navikt/k9-fe-period-utils';
import React from 'react';
import styles from './periodeRad.modules.css';
import styles from './periodeRad.module.css';

interface OwnProps {
perioder: Period[];
Expand Down
2 changes: 1 addition & 1 deletion packages/fakta-medlemskap/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fpsak-frontend/fakta-medlemskap",
"version": "1.0.0",
"module": "index.jsx",
"module": "index.ts",
"license": "MIT",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/fakta-opplaering/src/OpplaeringContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Tabs from './Tabs';
import GjennomgaaOpplaeringOversikt from './gjennomgaaOpplaering/GjennomgaaOpplaeringOversikt';
import messages from './i18n/nb_NO.json';
import NoedvendighetOversikt from './noedvendighet/NoedvendighetOversikt';
import styles from './opplaeringContainer.modules.css';
import styles from './opplaeringContainer.module.css';
import ReisetidOversikt from './reisetid/ReisetidOversikt';

interface TabItemProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Ikon from 'nav-frontend-ikoner-assets';
import React, { useState } from 'react';

import DokumentLink from './DokumentLink';
import styles from './dokumenterIVurderingen.modules.css';
import styles from './dokumenterIVurderingen.module.css';
import FilterList from './filter-list/FilterList';

const DokumenterIVurderingen = ({ dokumenter, onChange, onBlur, error, valgteDokumenter }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/fakta-opplaering/src/components/PeriodeRad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@navikt/ft-plattform-komponenter';
import { Period } from '@navikt/k9-fe-period-utils';
import React from 'react';
import styles from './periodeRad.modules.css';
import styles from './periodeRad.module.css';

interface OwnProps {
periode?: Period;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import classNames from 'classnames';
import Chevron from 'nav-frontend-chevron';
import React, { useState } from 'react';
import OutsideClickHandler from 'react-outside-click-handler';
import styles from './filterList.modules.css';
import styles from './filterList.module.css';

interface ChevronWithTextProps {
chevronDirection: 'opp' | 'ned';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';

import { DatePicker, DatePickerProps, DateValidationT, RangeValidationT, useRangeDatepicker } from '@navikt/ds-react';
import dayjs from 'dayjs';
import styles from './rangeDatepicker.modules.css';
import styles from './rangeDatepicker.module.css';

type OwnProps = {
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ import {
import React, { useContext } from 'react';
import { useIntl } from 'react-intl';
import DokumentLink from '../components/DokumentLink';
import styles from './GjennomgaaOpplaeringFerdigVisning.modules.css';
import styles from './GjennomgaaOpplaeringFerdigVisning.module.css';

interface OwnProps {
vurdering: GjennomgaaOpplaeringVurdering;
rediger: () => void;
}

const GjennomgaaOpplaeringFerdigVisning = ({ vurdering, rediger }: OwnProps) => {
const { readOnly, opplaeringDokumenter, saksbehandlere } =
useContext<FaktaOpplaeringContextTypes>(FaktaOpplaeringContext);
const { readOnly, opplaeringDokumenter, saksbehandlere } = useContext<FaktaOpplaeringContextTypes>(
FaktaOpplaeringContext,
);
const intl = useIntl();

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Heading } from '@navikt/ds-react';
import { InteractiveList } from '@navikt/ft-plattform-komponenter';
import React, { useEffect } from 'react';
import PeriodeRad from '../components/PeriodeRad';
import styles from './gjennomgaaOpplaeringNavigation.modules.css';
import styles from './gjennomgaaOpplaeringNavigation.module.css';
import GjennomgaaOpplaeringStatus from './konstanter';

interface OwnProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import React, { useContext } from 'react';

import { useIntl } from 'react-intl';
import DokumentLink from '../components/DokumentLink';
import styles from './noedvendighetFerdigVisning.modules.css';
import styles from './noedvendighetFerdigVisning.module.css';

interface OwnProps {
vurdering: NoedvendighetVurdering;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { InteractiveList } from '@navikt/ft-plattform-komponenter';
import React, { useEffect } from 'react';
import PeriodeRad from '../components/PeriodeRad';
import noedvendighetStatus from './konstanter';
import styles from './noedvendighetNavigation.modules.css';
import styles from './noedvendighetNavigation.module.css';

interface OwnProps {
perioder: NoedvendighetVurdering[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Box, LabelledContent, Margin } from '@navikt/ft-plattform-komponenter';
import React from 'react';

import { ReisetidVurdering } from './ReisetidTypes';
import styles from './beskrivelseFraSoeker.modules.css';
import styles from './beskrivelseFraSoeker.module.css';

interface OwnProps {
vurdering: ReisetidVurdering;
Expand Down
2 changes: 1 addition & 1 deletion packages/fakta-opplaering/src/reisetid/PeriodeRad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@navikt/ft-plattform-komponenter';
import { Period } from '@navikt/k9-fe-period-utils';
import React from 'react';
import styles from './periodeRad.modules.css';
import styles from './periodeRad.module.css';

interface OwnProps {
periode?: Period;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Vurderingsresultat } from '@k9-sak-web/types';
import BeskrivelseFraSoeker from './BeskrivelseFraSoeker';
import FraSoeknad from './FraSoeknad';
import { ReisetidVurdering } from './ReisetidTypes';
import styles from './reisetidFerdigVisning.modules.css';
import styles from './reisetidFerdigVisning.module.css';

interface OwnProps {
vurdering: ReisetidVurdering;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useEffect } from 'react';
import PeriodeRad from './PeriodeRad';
import { ReisetidVurdering } from './ReisetidTypes';
import ReisetidStatus from './konstanter';
import styles from './reisetidNavigation.modules.css';
import styles from './reisetidNavigation.module.css';

interface OwnProps {
perioder: ReisetidVurdering[];
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/fakta-verge/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fpsak-frontend/fakta-verge",
"version": "1.0.0",
"module": "index.jsx",
"module": "index.ts",
"license": "MIT",
"private": true,
"dependencies": {
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion packages/form/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "@fpsak-frontend/form",
"version": "1.0.0",
"module ": "index.js",
"main": "index.ts",
"module": "index.ts",
"license": "MIT",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/radioGroupField.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { messages } from '@fpsak-frontend/utils-test/src/intl-enzyme-test-helper
import RadioGroupField from './RadioGroupField';
import RadioOption from './RadioOption';

const MockForm = reduxForm({ form: 'mock', onSubmit: jest.fn() })(({ handleSubmit, children }) => (
const MockForm = reduxForm({ form: 'mock' })(({ handleSubmit, children }) => (
<form onSubmit={handleSubmit}>{children}</form>
));
const mountFieldInForm = (field, initialValues) =>
Expand Down
1 change: 1 addition & 0 deletions packages/modal-sett-pa-vent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@k9-sak-web/modal-sett-pa-vent",
"version": "1.0.0",
"main": "index.ts",
"module": "index.ts",
"license": "MIT",
"private": true,
Expand Down
File renamed without changes.
Loading
Loading