forked from directus/directus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In order to support ESM, files need to be imported and exported with file extenstions. While Jest seems to support ESM via hack config, we are using ts-jest, so in order to make file extensions to work, we need a moduleNameMapper configuration that allows to remove the file extension, so jest can resolve properly. Related links: kulshekhar/ts-jest#2475 kulshekhar/ts-jest#1057 https://dev.to/antongolub/ts-and-ts-jest-meet-type-module-5chc
- Loading branch information
1 parent
46f00d6
commit 1c1f261
Showing
66 changed files
with
213 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const parentConfig = require('../../.eslintrc.js'); | ||
|
||
module.exports = { | ||
...parentConfig, | ||
parserOptions: { | ||
...parentConfig.parserOptions, | ||
sourceType: 'module', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const parentConfig = require('../../.eslintrc.js'); | ||
|
||
module.exports = { | ||
...parentConfig, | ||
parserOptions: { | ||
sourceType: 'module', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
require('dotenv').config(); | ||
import { config as dotenv } from 'dotenv'; | ||
dotenv(); | ||
|
||
module.exports = { | ||
export default { | ||
preset: 'ts-jest', | ||
verbose: true, | ||
setupFiles: ['dotenv/config'], | ||
testURL: process.env.TEST_URL || 'http://localhost', | ||
collectCoverageFrom: ['src/**/*.ts'], | ||
testPathIgnorePatterns: ['dist'], | ||
moduleNameMapper: { | ||
'^@/(.*).js$': '<rootDir>/$1', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export * from './storage'; | ||
export * from './transport'; | ||
export * from '@/src/base/storage/index.js'; | ||
export * from '@/src/base/transport/index.js'; | ||
|
||
export * from './auth'; | ||
export * from './directus'; | ||
export * from './items'; | ||
export * from '@/src/base/auth.js'; | ||
export * from '@/src/base/directus.js'; | ||
export * from '@/src/base/items.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from './base'; | ||
export * from './memory'; | ||
export * from './localstorage'; | ||
export * from '@/src/base/storage/base.js'; | ||
export * from '@/src/base/storage/memory.js'; | ||
export * from '@/src/base/storage/localstorage.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './axios-transport'; | ||
export * from '@/src/base/transport/axios-transport.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
export * from './activity'; | ||
export * from './comments'; | ||
export * from './collections'; | ||
export * from './fields'; | ||
export * from './files'; | ||
export * from './folders'; | ||
export * from './permissions'; | ||
export * from './presets'; | ||
export * from './relations'; | ||
export * from './revisions'; | ||
export * from './roles'; | ||
export * from './server'; | ||
export * from './settings'; | ||
export * from './users'; | ||
export * from './utils'; | ||
export * from '@/src/handlers/activity.js'; | ||
export * from '@/src/handlers/collections.js'; | ||
export * from '@/src/handlers/comments.js'; | ||
export * from '@/src/handlers/fields.js'; | ||
export * from '@/src/handlers/files.js'; | ||
export * from '@/src/handlers/folders.js'; | ||
export * from '@/src/handlers/invites.js'; | ||
export * from '@/src/handlers/me.js'; | ||
export * from '@/src/handlers/permissions.js'; | ||
export * from '@/src/handlers/presets.js'; | ||
export * from '@/src/handlers/relations.js'; | ||
export * from '@/src/handlers/revisions.js'; | ||
export * from '@/src/handlers/roles.js'; | ||
export * from '@/src/handlers/server.js'; | ||
export * from '@/src/handlers/settings.js'; | ||
export * from '@/src/handlers/tfa.js'; | ||
export * from '@/src/handlers/users.js'; | ||
export * from '@/src/handlers/utils.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.