Skip to content

Commit

Permalink
feat: add examples for isolated function tests
Browse files Browse the repository at this point in the history
* feat: add ability to test functions in isolated-vm

* feat: provide `console` in isolated environment

* feat: provide `test` and `assert` for isolated function tests

* feat: support `globbing` isolated test files

* fix: drop _.isEqual for minified, vanilla code

* feat: add examples for isolated function tests
  • Loading branch information
archan937 authored Jun 1, 2022
1 parent 8957af8 commit 30b4f32
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions assets/app-functions/templates/test/helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const gql = async (query) => {
return [{ id: 1, name: 'Bruce Wayne' }];
};
4 changes: 4 additions & 0 deletions assets/app-functions/templates/test/say-hello.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
test('sayHello 1.0', async () => {
const output = await $app['sayHello 1.0']({ name: 'Bruce' });
assert(output, { greet: 'Hello, Bruce' });
});

0 comments on commit 30b4f32

Please sign in to comment.