-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): log config file loading status (#95)
* docs: explain tests process * feat(e2e): add tests structure * feat(cli): add logging on config file loading * chore(e2e): adapt tests * fix(cli): use generic type
- Loading branch information
1 parent
26ae8fd
commit 97f4b15
Showing
10 changed files
with
120 additions
and
24 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
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
2 changes: 2 additions & 0 deletions
2
packages/e2e/configs/config-path-info/directus-sync.config.cjs
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,2 @@ | ||
module.exports = { | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Context } from '../helpers/index.js'; | ||
|
||
export const configPathInfo = (context: Context) => { | ||
it('ensure logs show info about missing config file when wrong path is provided', async () => { | ||
// Init sync client | ||
const sync = await context.getSync( | ||
'sources/empty-collections', | ||
'wrong-path/directus-sync.config.cjs', | ||
); | ||
|
||
const output = await sync.diff(); | ||
const first = output.shift(); | ||
|
||
expect(first?.msg).toContain('No config file found'); | ||
expect(first?.msg).toContain('wrong-path/directus-sync.config.cjs'); | ||
}); | ||
|
||
it('ensure log shows info about missing config file for default files', async () => { | ||
// Init sync client | ||
const sync = await context.getSync('sources/empty-collections'); | ||
|
||
const output = await sync.diff(); | ||
const first = output.shift(); | ||
|
||
expect(first?.msg).toContain('No config file found'); | ||
expect(first?.msg).toContain('e2e/directus-sync.config.cjs'); | ||
expect(first?.msg).toContain('e2e/directus-sync.config.js'); | ||
expect(first?.msg).toContain('e2e/directus-sync.config.json'); | ||
}); | ||
|
||
it('ensure logs show info when config path exists', async () => { | ||
// Init sync client | ||
const sync = await context.getSync( | ||
'sources/empty-collections', | ||
'config-path-info/directus-sync.config.cjs', | ||
); | ||
|
||
const output = await sync.diff(); | ||
const first = output.shift(); | ||
|
||
expect(first?.msg).toContain('Loaded config file from'); | ||
expect(first?.msg).toContain('config-path-info/directus-sync.config.cjs'); | ||
}); | ||
}; |
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 @@ | ||
export * from './config-path-info.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