This repository was archived by the owner on Dec 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 160
test: Unit tests for Azure Index #155
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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,31 @@ | ||
| import AzureIndex from "./index"; | ||
| import { MockFactory } from "./test/mockFactory" | ||
| import { AzureInvoke } from "./plugins/invoke/azureInvoke"; | ||
| import { AzureLogs } from "./plugins/logs/azureLogs"; | ||
| import { AzureRemove } from "./plugins/remove/azureRemove"; | ||
| import { AzurePackage } from "./plugins/package/azurePackage"; | ||
| import { AzureDeployPlugin } from "./plugins/deploy/azureDeployPlugin"; | ||
| import { AzureLoginPlugin } from "./plugins/login/loginPlugin"; | ||
| import { AzureApimServicePlugin } from "./plugins/apim/apimServicePlugin"; | ||
| import { AzureApimFunctionPlugin } from "./plugins/apim/apimFunctionPlugin"; | ||
| import AzureProvider from "./provider/azureProvider"; | ||
|
|
||
| describe("Azure Index", () => { | ||
| it("contains all registered plugins", () => { | ||
| const sls = MockFactory.createTestServerless(); | ||
| const options = MockFactory.createTestServerlessOptions(); | ||
| const index = new AzureIndex(sls, options); | ||
| sls.setProvider = jest.fn(); | ||
|
|
||
| expect(sls.setProvider).toBeCalledWith("azure", new AzureProvider(sls)); | ||
|
|
||
| expect(sls.pluginManager.addPlugin).toBeCalledWith(AzurePackage); | ||
| expect(sls.pluginManager.addPlugin).toBeCalledWith(AzureInvoke); | ||
| expect(sls.pluginManager.addPlugin).toBeCalledWith(AzureLogs); | ||
| expect(sls.pluginManager.addPlugin).toBeCalledWith(AzureRemove); | ||
| expect(sls.pluginManager.addPlugin).toBeCalledWith(AzureLoginPlugin); | ||
| expect(sls.pluginManager.addPlugin).toBeCalledWith(AzureDeployPlugin); | ||
| expect(sls.pluginManager.addPlugin).toBeCalledWith(AzureApimServicePlugin); | ||
| expect(sls.pluginManager.addPlugin).toBeCalledWith(AzureApimFunctionPlugin); | ||
| }); | ||
| }); |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does adding this
defaultscrew up any of the exports that serverless cares about? We initially saw some weirdness trying to use standard ES6 module export features with the root sls plugin.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like as long as we have the
module.exportsat the end, it still works. Ran some deploys with this, and it seemed to work ok