forked from Agoric/dapp-treasury
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent Behavior When Preparing Ava Environment #49
Comments
When I import { test } from './prepare-test-env-ava.js'; where /**
* Like prepare-test-env but also sets up ses-ava and provides
* the ses-ava `test` function to be used as if it is the ava
* `test` function.
*/
import '@endo/init/pre-bundle-source.js';
import '@agoric/zoe/tools/prepare-test-env.js';
// eslint-disable-next-line import/no-unresolved -- https://github.com/avajs/ava/issues/2951
import rawTest from 'ava';
// XXX wrapTest not working https://github.com/endojs/endo/issues/1235
// import { wrapTest } from '@endo/ses-ava';
export const test = rawTest; Try that? |
So I observed that |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the best way to setup test environment with
ses
andava
?When I was trying to find an answer to this question I've come across two main ways to setup ava;
I also saw a
prepare-test-env-ava.js
at the notifier package which is similar to the one from zoe. I'll drop it's content anyway.Environement
fedf049435d7307311219fbab1b2b342ec6acce8
Problem
I can only make my tests work following the first approach but I'm concerned that I might be missing somethings by not making the tests work with approach two and it's sub-approach.
In order to narrow down the problem I've prepared a small test with multiple ava environments. The actual code is here.
This is the command I use to run the test;
cd dapp-pool-lending-protocol npx ava -v contract/test/avaSesEnv/test-avaSesEnv.js -m ses-ava
Below are the results;
When we fetch initiate test environment importing from
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
the console output;When we fetch initiate test environment importing from
import { test } from '@agoric/notifier/test/prepare-test-env-ava.js';
the console output;When I copy/paste the contents of prepare-test-env-ava.js to a file in the same directory and import it like this
import { test } from './prepare-test-env-ava.js';
the console output is;And if I do an import like this;
The console output;
Seems to be working.
It's seems very strange to me that I get different outputs every time I use different imports. What do you think? @dckc
The text was updated successfully, but these errors were encountered: