diff --git a/assets/jest.config.ts b/assets/jest.config.ts index 4bdea882c..19007202f 100644 --- a/assets/jest.config.ts +++ b/assets/jest.config.ts @@ -21,9 +21,9 @@ const config: JestConfigWithTsJest = { './js/test-utils/jest-setup.ts' ], moduleNameMapper: { - '^@Pimcore/(.*)$': '/js/src/$1', + '^@Pimcore/(.*)$': '/js/src/core/$1', '^@test-utils/(.*)$': '/js/test-utils/$1' - } + }, } export default config diff --git a/assets/js/src/core/components/example/__tests__/example.spec.tsx b/assets/js/src/core/components/example/__tests__/example.spec.tsx deleted file mode 100644 index 5b9061c32..000000000 --- a/assets/js/src/core/components/example/__tests__/example.spec.tsx +++ /dev/null @@ -1,25 +0,0 @@ -/** -* Pimcore -* -* This source file is available under two different licenses: -* - Pimcore Open Core License (POCL) -* - Pimcore Commercial License (PCL) -* Full copyright and license information is available in -* LICENSE.md which is distributed with this source code. -* -* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) -* @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL -*/ - -import React from 'react' -import '@testing-library/jest-dom' -import { render } from '@test-utils/test-utils' -import { Example } from '../example' - -test('displays button', async () => { - const { getByText } = render() - - const button = getByText('Example text') - - expect(button).toBeInTheDocument() -}) diff --git a/assets/package.json b/assets/package.json index 32243022c..92885a29f 100644 --- a/assets/package.json +++ b/assets/package.json @@ -14,7 +14,7 @@ "build-api-client": "npx @rtk-query/codegen-openapi ./js/build/api/openapi-config.ts", "lint": "eslint --ext .js,.jsx,.ts,.tsx ./js", "lint-fix": "eslint --ext .js,.jsx,.ts,.tsx ./js --fix", - "test": "jest --passWithNoTests", + "test": "jest ./js/src --passWithNoTests", "storybook": "storybook dev -p 6006" }, "types": "./dist/build/types/src/sdk/main.d.ts", diff --git a/assets/tsconfig.json b/assets/tsconfig.json index 99aa492a5..8c1ff4683 100644 --- a/assets/tsconfig.json +++ b/assets/tsconfig.json @@ -4,7 +4,7 @@ "module": "ESNext", "target": "es2017", "moduleResolution": "Node", - "types": ["reflect-metadata", "@types/webpack-env"], + "types": ["reflect-metadata", "@types/webpack-env", "jest"], "baseUrl": "./js/", "paths": { "@Pimcore/*": ["./src/core/*"],