Skip to content
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

Allow customizing the sandbox provided to FastBoot #57

Closed
ryanto opened this issue Jun 21, 2019 · 4 comments
Closed

Allow customizing the sandbox provided to FastBoot #57

ryanto opened this issue Jun 21, 2019 · 4 comments

Comments

@ryanto
Copy link
Member

ryanto commented Jun 21, 2019

As a first step we can do this as a one time boot config for ECFT's FastBoot instance.

In the future it might be nice to do a per test sandbox.

@dnalagatla
Copy link
Contributor

@ryanto As discussed the sandbox Globals will include basic properties in the global scope. The Basic usecase we have is to set noop for clearInterval and throw an error for setInterval in fastboot environment. Example

let sanboxGlobals = {
   clearInterval: function() {
      // noop
  }
} 

const fastboot = new FastBoot({
    distPath,
    sanboxGlobal
});

Basically a hook during the setup which can take Globals object and passed on to the fastboot constructor as sandboxGlobals property.

Thank you for looking into this task.

@ryanto
Copy link
Member Author

ryanto commented Jun 25, 2019

Ok great!

I think the idea here will be to have the generator create a config/fastboot-testing.js file that will look something like this...

module.exports = {
  resilient: false,
  sandboxGlobals: {}
};

Addon docs does something similar for its custom config, so I'm going to steal that code :D

@dnalagatla
Copy link
Contributor

@ryanto, sorry I missed responding to the comment. That looks like a good Idea. Thank you for looking into that. I have some time right now. If you have can more detail on the generation logic, I can work on a PR for that.

@ryanto
Copy link
Member Author

ryanto commented Sep 29, 2019

Hey, closing this issue since this is complete! Docs are here: https://embermap.github.io/ember-cli-fastboot-testing/docs/fastboot-configuration

@ryanto ryanto closed this as completed Sep 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants