Skip to content

Commit

Permalink
test: update test dependencies and rearrange files (#1432)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikian authored Aug 5, 2023
1 parent 7392739 commit d8a1126
Show file tree
Hide file tree
Showing 6 changed files with 575 additions and 388 deletions.
25 changes: 25 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
transform: {
'\\.(ts|tsx)$': 'ts-jest',
},
testEnvironment: 'jsdom',
testEnvironmentOptions: {
url: 'http://localhost',
},
testMatch: ['**/rtl-spec/*.spec.*', '**/tests/**/*-spec.{ts,tsx}'],
resetMocks: true,
bail: true,
resetModules: true,
snapshotSerializers: ['enzyme-to-json/serializer'],
globalSetup: '<rootDir>/tests/globalSetup.ts',
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
moduleFileExtensions: ['js', 'jsx', 'json', 'ts', 'tsx'],
testPathIgnorePatterns: ['/.tmp/'],
coverageReporters: ['json', 'html', 'lcov'],
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!**/*.d.ts', '!**/*constants.ts'],
coveragePathIgnorePatterns: ['/node_modules/', '/tests/.*\\.(ts|js)$'],
moduleNameMapper: {
'.*releases.json$': '<rootDir>/static/releases.json',
'\\.(css|less|scss)$': '<rootDir>/tests/mocks/styles.ts',
},
};
48 changes: 0 additions & 48 deletions jest.json

This file was deleted.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"package": "electron-forge package",
"publish": "electron-forge publish",
"start": "rimraf ./.webpack && electron-forge start --",
"test": "jest --config=jest.json",
"test:ci": "jest --ci --config=jest.json --coverage --runInBand --reporters=jest-junit",
"test:report": "jest --config=jest.json --json --bail=false --outputFile=report.json | true",
"test": "jest",
"test:ci": "jest --ci --coverage --runInBand --reporters=jest-junit",
"test:report": "jest --json --bail=false --outputFile=report.json | true",
"tsc": "tsc --noEmit -p .",
"electron-releases": "node --unhandled-rejections=strict -r ts-node/register ./tools/fetch-releases.ts",
"postinstall": "husky install && npm run electron-releases"
Expand Down Expand Up @@ -84,16 +84,16 @@
"@electron/lint-roller": "^1.0.1",
"@octokit/core": "^3.5.1",
"@reforged/maker-appimage": "^3.3.0",
"@testing-library/dom": "^8.0.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/dom": "^9.3.1",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^12.1.5",
"@testing-library/user-event": "^14.2.0",
"@testing-library/user-event": "^14.4.3",
"@types/classnames": "^2.2.11",
"@types/enzyme": "^3.10.8",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/fs-extra": "^9.0.7",
"@types/getos": "^3.0.1",
"@types/jest": "^29.5.0",
"@types/jest": "^29.5.3",
"@types/log-symbols": "^3.0.0",
"@types/node": "^18.11.18",
"@types/react": "^16.14.0",
Expand Down Expand Up @@ -121,8 +121,8 @@
"fetch-mock-jest": "^1.5.1",
"fork-ts-checker-webpack-plugin": "^8.0.0",
"husky": "^8.0.3",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"jest-junit": "^16.0.0",
"less": "^4.1.1",
"less-loader": "^11.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { runInAction } from 'mobx';

import { GistActionState } from '../src/interfaces';
import { AddressBar } from '../src/renderer/components/commands-address-bar';
import { AppState } from '../src/renderer/state';
import { GistActionState } from '../../src/interfaces';
import { AddressBar } from '../../src/renderer/components/commands-address-bar';
import { AppState } from '../../src/renderer/state';

describe('AddressBar component', () => {
let store: AppState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { mocked } from 'jest-mock';

import { InstallState, VersionSource } from '../src/interfaces';
import { BisectHandler } from '../src/renderer/components/commands-bisect';
import { AppState } from '../src/renderer/state';
import { InstallState, VersionSource } from '../../src/interfaces';
import { BisectHandler } from '../../src/renderer/components/commands-bisect';
import { AppState } from '../../src/renderer/state';

describe('Bisect commands component', () => {
let store: AppState;
Expand Down
Loading

0 comments on commit d8a1126

Please sign in to comment.