-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da3ba50
commit 8bd1bf0
Showing
12 changed files
with
128 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './executeExample'; | ||
export * from './setup'; |
2 changes: 1 addition & 1 deletion
2
packages/case-core/src/core/executeExample/setup/setupMock/index.ts
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,2 +1,2 @@ | ||
export * from './setupMock'; | ||
export * from '../../../../diffmatch/plugins/loadPlugin'; | ||
export * from '../../../plugins/mockExecutors'; |
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
3 changes: 0 additions & 3 deletions
3
packages/case-core/src/core/executeExample/setup/setupMock/mockExecutors.ts
This file was deleted.
Oops, something went wrong.
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 @@ | ||
export * from './loadPlugins'; |
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,3 @@ | ||
import type { MockSetupFns } from '../../diffmatch/plugins/types'; | ||
|
||
export const MockExecutors: MockSetupFns = {} as MockSetupFns; |
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
39 changes: 39 additions & 0 deletions
39
packages/case-core/src/diffmatch/plugins/loadPlugin.spec.ts
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,39 @@ | ||
import { CaseConfigurationError } from '@contract-case/case-plugin-base'; | ||
import { MatcherExecutors } from '../matching/MatcherExecutors'; | ||
import { loadPlugin } from './loadPlugin'; | ||
import { EMPTY_MATCH_CONTEXT } from '../../__tests__/testContext'; | ||
import { MockSetupFns } from './types'; | ||
|
||
describe('plugin loader', () => { | ||
beforeEach(() => { | ||
Object.keys(MatcherExecutors).forEach((key) => { | ||
// clear all executors | ||
delete MatcherExecutors[key as keyof typeof MatcherExecutors]; | ||
}); | ||
}); | ||
|
||
describe('with LOAD_IN_PROGRESS as the version name', () => { | ||
it('throws a configuration error', () => { | ||
expect(() => { | ||
loadPlugin({} as MockSetupFns, EMPTY_MATCH_CONTEXT, { | ||
name: 'Empty test plugin', | ||
version: 'LOAD_IN_PROGRESS', | ||
matcherExecutors: {}, | ||
setupMocks: {}, | ||
}); | ||
}).toThrow(CaseConfigurationError); | ||
}); | ||
}); | ||
describe('with a valid version', () => { | ||
it('loads an empty plugin', () => { | ||
expect(() => { | ||
loadPlugin({} as MockSetupFns, EMPTY_MATCH_CONTEXT, { | ||
name: 'Empty test plugin', | ||
version: '0.0.0', | ||
matcherExecutors: {}, | ||
setupMocks: {}, | ||
}); | ||
}).not.toThrow(); | ||
}); | ||
}); | ||
}); |
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