mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-07-24 06:35:42 +00:00
Swap Jest test runner (#719)
This commit is contained in:
@@ -1,17 +0,0 @@
|
|||||||
// Copyright 2017-2023 @polkadot/ui authors & contributors
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
const config = require('@polkadot/dev/config/jest.cjs');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
...config,
|
|
||||||
moduleNameMapper: {
|
|
||||||
'@polkadot/react-(identicon|qr)(.*)$': '<rootDir>/packages/react-$1/src/$2',
|
|
||||||
'@polkadot/reactnative-(identicon)(.*)$': '<rootDir>/packages/reactnative-$1/src/$2',
|
|
||||||
'@polkadot/ui-(assets|keyring|settings|shared)(.*)$': '<rootDir>/packages/ui-$1/src/$2',
|
|
||||||
'\\.(css|less)$': 'empty/object',
|
|
||||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': 'empty/object'
|
|
||||||
},
|
|
||||||
setupFilesAfterEnv: ['<rootDir>/jest/setupEnv.js'],
|
|
||||||
testEnvironment: 'jsdom'
|
|
||||||
};
|
|
||||||
+3
-3
@@ -28,13 +28,13 @@
|
|||||||
"example:vue": "yarn build && cd packages/example-vue && yarn polkadot-exec-webpack --config webpack.config.cjs",
|
"example:vue": "yarn build && cd packages/example-vue && yarn polkadot-exec-webpack --config webpack.config.cjs",
|
||||||
"lint": "polkadot-dev-run-lint",
|
"lint": "polkadot-dev-run-lint",
|
||||||
"postinstall": "polkadot-dev-yarn-only",
|
"postinstall": "polkadot-dev-yarn-only",
|
||||||
"test": "polkadot-dev-run-test --env jest -- --coverage --runInBand",
|
"test": "polkadot-dev-run-test --env browser",
|
||||||
"test:one": "polkadot-dev-run-test"
|
"test:one": "polkadot-dev-run-test --env browser"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.12",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/runtime": "^7.20.13",
|
"@babel/runtime": "^7.20.13",
|
||||||
"@polkadot/dev": "^0.68.40",
|
"@polkadot/dev": "^0.68.41",
|
||||||
"@polkadot/x-bundle": "^10.4.2",
|
"@polkadot/x-bundle": "^10.4.2",
|
||||||
"@types/jest": "^29.4.0",
|
"@types/jest": "^29.4.0",
|
||||||
"babel-loader": "^8.3.0",
|
"babel-loader": "^8.3.0",
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ describe('KeyringOption', (): void => {
|
|||||||
keyringOption.init(state as KeyringStruct);
|
keyringOption.init(state as KeyringStruct);
|
||||||
|
|
||||||
// second call
|
// second call
|
||||||
expect((): void => {
|
expect(
|
||||||
keyringOption.init(state as KeyringStruct);
|
() => keyringOption.init(state as KeyringStruct)
|
||||||
}).toThrowError('Unable to initialise options more than once');
|
).toThrow('Unable to initialise options more than once');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
// Copyright 2017-2023 @polkadot/ui-shared authors & contributors
|
// Copyright 2017-2023 @polkadot/ui-shared authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import { serializeToString } from 'xmlserializer';
|
import xs from 'xmlserializer';
|
||||||
|
|
||||||
import { circle } from './circle';
|
import { circle } from './circle';
|
||||||
|
|
||||||
describe('circle', (): void => {
|
describe('circle', (): void => {
|
||||||
it('creates a basic SVG circle element', (): void => {
|
it('creates a basic SVG circle element', (): void => {
|
||||||
expect(
|
expect(
|
||||||
serializeToString(
|
xs.serializeToString(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
||||||
circle(123, 12, 34) as any
|
circle(123, 12, 34) as any
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
// Copyright 2017-2023 @polkadot/ui-shared authors & contributors
|
// Copyright 2017-2023 @polkadot/ui-shared authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import { serializeToString } from 'xmlserializer';
|
import xs from 'xmlserializer';
|
||||||
|
|
||||||
import { element } from './element';
|
import { element } from './element';
|
||||||
|
|
||||||
describe('element', (): void => {
|
describe('element', (): void => {
|
||||||
it('creates a basic SVG element', (): void => {
|
it('creates a basic SVG element', (): void => {
|
||||||
expect(
|
expect(
|
||||||
serializeToString(
|
xs.serializeToString(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
||||||
element(123) as any
|
element(123) as any
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
// Copyright 2017-2023 @polkadot/ui-shared authors & contributors
|
// Copyright 2017-2023 @polkadot/ui-shared authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import { serializeToString } from 'xmlserializer';
|
import xs from 'xmlserializer';
|
||||||
|
|
||||||
import { rect } from './rect';
|
import { rect } from './rect';
|
||||||
|
|
||||||
describe('rect', (): void => {
|
describe('rect', (): void => {
|
||||||
it('creates a basic SVG rect element', (): void => {
|
it('creates a basic SVG rect element', (): void => {
|
||||||
expect(
|
expect(
|
||||||
serializeToString(
|
xs.serializeToString(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
||||||
rect(123) as any
|
rect(123) as any
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
// Copyright 2017-2023 @polkadot/ui-shared authors & contributors
|
// Copyright 2017-2023 @polkadot/ui-shared authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import { serializeToString } from 'xmlserializer';
|
import xs from 'xmlserializer';
|
||||||
|
|
||||||
import { svg } from './svg';
|
import { svg } from './svg';
|
||||||
|
|
||||||
describe('svg', (): void => {
|
describe('svg', (): void => {
|
||||||
it('creates a basic SVG element', (): void => {
|
it('creates a basic SVG element', (): void => {
|
||||||
expect(
|
expect(
|
||||||
serializeToString(
|
xs.serializeToString(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
||||||
svg('rect') as any
|
svg('rect') as any
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2182,9 +2182,9 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@polkadot/dev@npm:^0.68.40":
|
"@polkadot/dev@npm:^0.68.41":
|
||||||
version: 0.68.40
|
version: 0.68.41
|
||||||
resolution: "@polkadot/dev@npm:0.68.40"
|
resolution: "@polkadot/dev@npm:0.68.41"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/cli": ^7.20.7
|
"@babel/cli": ^7.20.7
|
||||||
"@babel/core": ^7.20.12
|
"@babel/core": ^7.20.12
|
||||||
@@ -2286,7 +2286,7 @@ __metadata:
|
|||||||
polkadot-exec-swc: scripts/polkadot-exec-swc.mjs
|
polkadot-exec-swc: scripts/polkadot-exec-swc.mjs
|
||||||
polkadot-exec-tsc: scripts/polkadot-exec-tsc.mjs
|
polkadot-exec-tsc: scripts/polkadot-exec-tsc.mjs
|
||||||
polkadot-exec-webpack: scripts/polkadot-exec-webpack.mjs
|
polkadot-exec-webpack: scripts/polkadot-exec-webpack.mjs
|
||||||
checksum: efa0673933e2fec834b2d0a29c454c3d95e54c4608ea6eea8b4dc3730344234219afb61840d475771b873d6d34a67ae537e8451f73b0dd43eb82e440a1733966
|
checksum: a3e5d0acca6393c0d2cda36d5000ce605bf7cc0da6dd427947a82fe7d7783ce3ba2711bf4167d69178fc227e5ab86bd8ef75b3292d71328a817d0c3030305e95
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -13928,7 +13928,7 @@ __metadata:
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@babel/core": ^7.20.12
|
"@babel/core": ^7.20.12
|
||||||
"@babel/runtime": ^7.20.13
|
"@babel/runtime": ^7.20.13
|
||||||
"@polkadot/dev": ^0.68.40
|
"@polkadot/dev": ^0.68.41
|
||||||
"@polkadot/x-bundle": ^10.4.2
|
"@polkadot/x-bundle": ^10.4.2
|
||||||
"@types/jest": ^29.4.0
|
"@types/jest": ^29.4.0
|
||||||
babel-loader: ^8.3.0
|
babel-loader: ^8.3.0
|
||||||
|
|||||||
Reference in New Issue
Block a user