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

Code Streaming #26

Open
steven-pribilinskiy opened this issue Mar 23, 2023 · 0 comments
Open

Code Streaming #26

steven-pribilinskiy opened this issue Mar 23, 2023 · 0 comments

Comments

@steven-pribilinskiy
Copy link

steven-pribilinskiy commented Mar 23, 2023

Reading through the article and through this support thread, this module-federation example, and the tweets around Code Streaming, I'm a bit confused on how we can write an integration test with jest where the federated apps could be resolved from a module that is fetched from a server (hosted on S3) instead of require-ing from the hard drive.

@ScriptedAlchemy in regards to tests, is the idea to use something like fetch/axios to load the module and then add it to the require.cache?

webpack.test.config.js:

const reunited = (remotePath, name) => `promise new Promise(resolve => {
    const fetch = require('node-fetch');
    fetch('${remotePath}').then(response => response.text()).then(moduleCode => {
      require.cache[name] = moduleCode;
      resolve(moduleCode);
    });
  })`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant