-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): ensure test files can be run out of the box with jest (#327)
* ensure test files can be run out of the box with jest
- Loading branch information
Showing
3 changed files
with
15 additions
and
9 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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
/* globals describe it */ | ||
const should = require('should'); | ||
/* globals describe, expect, test, it */ | ||
|
||
const zapier = require('zapier-platform-core'); | ||
|
||
// Use this to make test calls into your app: | ||
const App = require('../../index'); | ||
const appTester = zapier.createAppTester(App); | ||
// read the `.env` file into the environment, if available | ||
zapier.tools.env.inject(); | ||
|
||
describe('My App', () => { | ||
it('should run <%= ACTION_PLURAL %>.<%= KEY %>', async () => { | ||
describe('<%= ACTION_PLURAL %>.<%= KEY %>', () => { | ||
it('should run', async () => { | ||
const bundle = { inputData: {} }; | ||
|
||
const results = await appTester(App.<%= ACTION_PLURAL %>.<%= KEY %>.<%= MAYBE_RESOURCE %>operation.perform, bundle); | ||
should.exist(results); | ||
expect(results).toBeDefined(); | ||
// TODO: add more assertions | ||
}); | ||
}); |
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