Skip to content

Code Streaming #26

@steven-pribilinskiy

Description

@steven-pribilinskiy

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);
    });
  })`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions