mirror of
https://github.com/strapi/strapi.git
synced 2025-06-27 00:41:25 +00:00
test: restructure test dirs
This commit is contained in:
parent
a0da7e73e1
commit
cf82c830d8
2
.github/filters.yaml
vendored
2
.github/filters.yaml
vendored
@ -6,7 +6,7 @@ backend:
|
||||
- 'packages/**/strapi-server.js'
|
||||
- 'packages/{utils,generators,cli,providers}/**'
|
||||
- 'packages/core/*/{lib,bin,ee}/**'
|
||||
- 'api-tests/**'
|
||||
- 'tests/api/**'
|
||||
frontend:
|
||||
- '.github/actions/yarn-nm-install/*.yml'
|
||||
- '.github/workflows/**'
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -145,8 +145,8 @@ front-workspace.code-workspace
|
||||
############################
|
||||
playwright-report
|
||||
test-results
|
||||
!e2e/data/*.tar
|
||||
e2e/.env
|
||||
!tests/e2e/data/*.tar
|
||||
tests/e2e/.env
|
||||
|
||||
############################
|
||||
# Strapi
|
||||
|
@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
setupFilesAfterEnv: [__dirname + '/test/setup/unit.setup.js'],
|
||||
setupFilesAfterEnv: [__dirname + '/tests/setup/unit.setup.js'],
|
||||
modulePathIgnorePatterns: ['.cache', 'dist'],
|
||||
testPathIgnorePatterns: ['.testdata.js', '.test.utils.js', '.d.ts'],
|
||||
testMatch: ['**/__tests__/**/*.{js,ts,jsx,tsx}'],
|
||||
|
@ -4,7 +4,7 @@ module.exports = {
|
||||
displayName: 'API integration tests',
|
||||
testMatch: ['**/?(*.)+(spec|test).api.(js|ts)'],
|
||||
testEnvironment: 'node',
|
||||
setupFilesAfterEnv: ['<rootDir>/test/setup/jest-api.setup.js'],
|
||||
setupFilesAfterEnv: ['<rootDir>/tests/setup/jest-api.setup.js'],
|
||||
coveragePathIgnorePatterns: [
|
||||
'<rootDir>/dist/',
|
||||
'<rootDir>/node_modules/',
|
||||
|
12
package.json
12
package.json
@ -47,11 +47,11 @@
|
||||
"prettier:other": "prettier --cache --cache-strategy content \"**/*.{md,mdx,css,scss,yaml,yml}\"",
|
||||
"prettier:write": "prettier --write \"**/*.{js,ts,jsx,tsx,json,md,mdx,css,scss,yaml,yml}\"",
|
||||
"setup": "yarn && yarn clean && yarn build --skip-nx-cache",
|
||||
"test:api": "node test/scripts/run-api-tests.js",
|
||||
"test:api": "node tests/scripts/run-api-tests.js",
|
||||
"test:clean": "rimraf ./coverage",
|
||||
"test:e2e": "node test/scripts/run-e2e-tests.js",
|
||||
"test:e2e:clean": "node test/scripts/run-e2e-tests.js clean",
|
||||
"test:e2e:debug": "node test/scripts/run-e2e-tests.js --debug",
|
||||
"test:e2e": "node tests/scripts/run-e2e-tests.js",
|
||||
"test:e2e:clean": "node tests/scripts/run-e2e-tests.js clean",
|
||||
"test:e2e:debug": "node tests/scripts/run-e2e-tests.js --debug",
|
||||
"test:front": "cross-env IS_EE=true jest --config jest.config.front.js",
|
||||
"test:front:all": "cross-env IS_EE=true nx run-many --target=test:front --nx-ignore-cycles",
|
||||
"test:front:all:ce": "cross-env IS_EE=false nx run-many --target=test:front:ce --nx-ignore-cycles",
|
||||
@ -60,8 +60,8 @@
|
||||
"test:front:update:ce": "yarn test:front:ce -u",
|
||||
"test:front:watch": "cross-env IS_EE=true run test:front --watch",
|
||||
"test:front:watch:ce": "cross-env IS_EE=false run test:front --watch",
|
||||
"test:generate-app": "yarn build:ts && node test/scripts/generate-test-app.js",
|
||||
"test:generate-app:no-build": "node test/scripts/generate-test-app.js",
|
||||
"test:generate-app": "yarn build:ts && node tests/scripts/generate-test-app.js",
|
||||
"test:generate-app:no-build": "node tests/scripts/generate-test-app.js",
|
||||
"test:ts": "yarn test:ts:packages && yarn test:ts:front && yarn test:ts:back",
|
||||
"test:ts:back": "nx run-many --target=test:ts:back --nx-ignore-cycles",
|
||||
"test:ts:front": "nx run-many --target=test:ts:front --nx-ignore-cycles",
|
||||
|
@ -2,7 +2,7 @@ import { errors } from '@strapi/utils';
|
||||
import { omit } from 'lodash/fp';
|
||||
// @ts-expect-error - types are not generated for this file
|
||||
// eslint-disable-next-line import/no-relative-packages
|
||||
import createContext from '../../../../../../../test/helpers/create-context';
|
||||
import createContext from '../../../../../../../tests/helpers/create-context';
|
||||
import constants from '../../services/constants';
|
||||
import apiTokenController from '../api-token';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// @ts-expect-error - types are not generated for this file
|
||||
// eslint-disable-next-line import/no-relative-packages
|
||||
import createContext from '../../../../../../../test/helpers/create-context';
|
||||
import createContext from '../../../../../../../tests/helpers/create-context';
|
||||
import contentApiController from '../content-api';
|
||||
|
||||
describe('Content API permissions', () => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
// @ts-expect-error - types are not generated for this file
|
||||
// eslint-disable-next-line import/no-relative-packages
|
||||
import createContext from '../../../../../../../test/helpers/create-context';
|
||||
import createContext from '../../../../../../../tests/helpers/create-context';
|
||||
import permissionController from '../permission';
|
||||
|
||||
describe('Permission Controller', () => {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { errors } from '@strapi/utils';
|
||||
// @ts-expect-error - types are not generated for this file
|
||||
// eslint-disable-next-line import/no-relative-packages
|
||||
import createContext from '../../../../../../../test/helpers/create-context';
|
||||
import createContext from '../../../../../../../tests/helpers/create-context';
|
||||
import roleController from '../role';
|
||||
|
||||
describe('Role controller', () => {
|
||||
|
@ -2,7 +2,7 @@ import { errors } from '@strapi/utils';
|
||||
import { omit } from 'lodash/fp';
|
||||
// @ts-expect-error - types are not generated for this file
|
||||
// eslint-disable-next-line import/no-relative-packages
|
||||
import createContext from '../../../../../../../../test/helpers/create-context';
|
||||
import createContext from '../../../../../../../../tests/helpers/create-context';
|
||||
import constants from '../../../services/constants';
|
||||
import transferTokenController from '../../transfer/token';
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { errors } from '@strapi/utils';
|
||||
// @ts-expect-error - types are not generated for this file
|
||||
// eslint-disable-next-line import/no-relative-packages
|
||||
import createContext from '../../../../../../../test/helpers/create-context';
|
||||
import createContext from '../../../../../../../tests/helpers/create-context';
|
||||
import userController from '../user';
|
||||
|
||||
describe('User Controller', () => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* eslint-disable import/no-relative-packages */
|
||||
// @ts-expect-error - test purposes
|
||||
import createContext from '../../../../../../../test/helpers/create-context';
|
||||
import createContext from '../../../../../../../tests/helpers/create-context';
|
||||
import adminAuthStrategy from '../admin';
|
||||
|
||||
describe('Admin Auth Strategy', () => {
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-disable import/no-relative-packages */
|
||||
import { errors } from '@strapi/utils';
|
||||
// @ts-expect-error - test purposes
|
||||
import createContext from '../../../../../../../test/helpers/create-context';
|
||||
import createContext from '../../../../../../../tests/helpers/create-context';
|
||||
import apiTokenStrategy from '../api-token';
|
||||
|
||||
describe('API Token Auth Strategy', () => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
// @ts-expect-error - types are not generated for this file
|
||||
// eslint-disable-next-line import/no-relative-packages
|
||||
import createContext from '../../../../../../../test/helpers/create-context';
|
||||
import createContext from '../../../../../../../tests/helpers/create-context';
|
||||
import contentTypes from '../content-types';
|
||||
|
||||
describe('Content Types', () => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
// @ts-expect-error - types are not generated for this file
|
||||
// eslint-disable-next-line import/no-relative-packages
|
||||
import createContext from '../../../../../../../test/helpers/create-context';
|
||||
import createContext from '../../../../../../../tests/helpers/create-context';
|
||||
import relations from '../relations';
|
||||
|
||||
const contentTypes = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
// @ts-expect-error - types are not generated for this file
|
||||
// eslint-disable-next-line import/no-relative-packages
|
||||
import createContext from '../../../../../../../test/helpers/create-context';
|
||||
import createContext from '../../../../../../../tests/helpers/create-context';
|
||||
import singleTypes from '../single-types';
|
||||
import populateBuilder from '../../services/populate-builder';
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import crypto from 'crypto';
|
||||
// eslint-disable-next-line import/no-relative-packages
|
||||
import createContext from '../../../../../../../tests/helpers/create-context';
|
||||
import { generateAdminUserHash } from '../admin-user-hash';
|
||||
import createContext from '../../../../../../../test/helpers/create-context';
|
||||
|
||||
describe('user email hash', () => {
|
||||
test('should create a hash from admin user email', () => {
|
||||
|
@ -3,7 +3,7 @@
|
||||
import { omit } from 'lodash';
|
||||
import { createStrapiInstance } from 'api-tests/strapi';
|
||||
import { createAuthRequest } from 'api-tests/request';
|
||||
import constants from '../../../packages/core/admin/server/src/services/constants';
|
||||
import constants from '../../../../packages/core/admin/server/src/services/constants';
|
||||
|
||||
describe('Admin API Token v2 CRUD (api)', () => {
|
||||
let rq;
|
@ -1,7 +1,7 @@
|
||||
import { omit } from 'lodash';
|
||||
import { createStrapiInstance } from 'api-tests/strapi';
|
||||
import { createAuthRequest } from 'api-tests/request';
|
||||
import constants from '../../../packages/core/admin/server/src/services/constants';
|
||||
import constants from '../../../../packages/core/admin/server/src/services/constants';
|
||||
|
||||
describe('Admin Transfer Token CRUD (api)', () => {
|
||||
let rq;
|
@ -8,7 +8,7 @@ import { describeOnCondition } from 'api-tests/utils';
|
||||
import {
|
||||
WORKFLOW_MODEL_UID,
|
||||
ENTITY_STAGE_ATTRIBUTE,
|
||||
} from '../../../../packages/core/admin/ee/server/src/constants/workflows';
|
||||
} from '../../../../../packages/core/admin/ee/server/src/constants/workflows';
|
||||
|
||||
const edition = process.env.STRAPI_DISABLE_EE === 'true' ? 'CE' : 'EE';
|
||||
|
@ -13,7 +13,7 @@ import {
|
||||
WORKFLOW_MODEL_UID,
|
||||
ENTITY_STAGE_ATTRIBUTE,
|
||||
ENTITY_ASSIGNEE_ATTRIBUTE,
|
||||
} from '../../../../packages/core/admin/ee/server/src/constants/workflows';
|
||||
} from '../../../../../packages/core/admin/ee/server/src/constants/workflows';
|
||||
|
||||
const edition = process.env.STRAPI_DISABLE_EE === 'true' ? 'CE' : 'EE';
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 787 B After Width: | Height: | Size: 787 B |
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user