Giter VIP home page Giter VIP logo

fs-monkey's Introduction

fs-monkey

Monkey-patches for filesystem related things.

  • Rewrite require function to load Node's modules from memory.
  • Or rewrite the whole fs filesystem module.

Install

npm install --save fs-monkey

Terms

An fs-like object is an object that implements methods of Node's filesystem API. It is denoted as vol:

let vol = {
    readFile: () => { /* ... */ },
    readFileSync: () => { /* ... */ },
    // etc...
}

Reference

  • patchFs - rewrites Node's filesystem module fs with fs-like object vol
  • patchRequire - rewrites require function, patches Node's module module to use a given fs-like object for module loading

License

Unlicense - public domain.

fs-monkey's People

Contributors

alienzhou avatar bytesnz avatar dependabot[bot] avatar dylannil avatar fearthecowboy avatar g-rath avatar jvasseur avatar renovate-bot avatar renovate[bot] avatar samuelcabralcruz avatar semantic-release-bot avatar streamich avatar teagrinder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fs-monkey's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Preset name not found within published preset config (monorepo:angularmaterial). Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

require not working inspite of using patchRequire in Jest

I'm trying to write jest test for SSR middleware that requires the webpack stat file on the server, but I'm having issues getting require of the mocked file to work, here's my current setup

import path from 'path';
import fs from 'fs';
import { Volume } from 'memfs';
import { patchRequire } from 'fs-monkey';

jest.mock('fs', () => {
 const fs = jest.requireActual('fs');
 const { ufs } = require('unionfs');

 ufs.reset = () => {
   ufs.fss = [fs]
 }
 
 return ufs.use(fs) 
});

 describe('react SSR', () => {

    beforeEach(() => {
      const vol = Volume.fromJSON({
        './dist/public/loadable-stats.json': JSON.stringify({
         ....
        }, process.cwd());

       // fs is the unionfs mock here
       fs.use(vol);
       
       patchRequire(fs);
 
      // I get the content here
      console.log(
        'Read Sync File contents:: %s \n',
        fs.readFileSync(path.join(process.cwd(), './dist/public/loadable-stats.json'))
      );

       // This returns an error
      console.log(
         'Require File contents:: %s \n',
         require(path.join(process.cwd(), './dist/public/loadable-stats.json'))
      );

    });

   afterEach(() => {
       fs.reset();
   })

 })

I can't seem to figure out why it's not working, I'd appreciate any insight you might have about why it isn't working as it should, thank you!!

Restore of the required pacthed

There is a way to require the files generated by the memfs via the method patchRequire, but how to replace the require patched of the original require. Or there is no need to have that restorePatchRequire?

Thanks to your time.

Does it support yarn@berry

  1. go and git clone https://github.com/wood1986/fs-monkey-bugs.git
  2. compare the output of ./yarn1.sh and ./yarn2.sh

./yarn1.sh can run without error and output

Hello from memfs.log.js
Hello from fs.log.js

./yarn2.sh can output

Error: Qualified path resolution failed - none of the candidates can be found on the disk.

Source path: /memfs.log.js
Rejected candidate: /memfs.log.js
Rejected candidate: /memfs.log.js.js
Rejected candidate: /memfs.log.js.json
Rejected candidate: /memfs.log.js.node

I cannot identify if it is yarn@berry issue or fs-monkey

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): lock file maintenance

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/checks.yml
  • actions/checkout v3
  • actions/setup-node v3
  • actions/checkout v3
  • actions/setup-node v3
  • actions/checkout v3
  • actions/setup-node v3
npm
package.json
  • @babel/cli ^7.18.6
  • @babel/core ^7.18.6
  • @babel/preset-env ^7.18.6
  • @semantic-release/changelog ^6.0.1
  • @semantic-release/git ^10.0.1
  • @semantic-release/npm ^9.0.1
  • @types/jest ^29.0.0
  • @types/node ^8.10.66
  • babel-jest ^29.0.0
  • jest ^29.0.0
  • semantic-release ^19.0.3
  • source-map-support ^0.5.21
nvm
.nvmrc
  • node 8.17.0

  • Check this box to trigger a request for Renovate to run again on this repository

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


No npm token specified.

An npm token must be created and set in the NPM_TOKEN environment variable on your CI environment.

Please make sure to create an npm token and to set it in the NPM_TOKEN environment variable on your CI environment. The token must allow to publish to the registry https://registry.npmjs.org/.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

patchRequire doesn't work on Windows?

First: AWESOME -- I was thinking about writing this exact same thing, but I'm happy that you did such a great job on this and it's friends (memfs, unionfs, etc...)

Now, down to brass tacks --

it would appear that patchRequire doesn't work on Windows -my guess being that that paths via memfs are always translated into unix-style and the code in require knows that on windows it has to do windows-specific work.

I was going to debug into this, but any knowledge you had would be wonderful

rm and rmSync don't work on a patched-in memfs volume

Deleting a directory with rm or rmSync does not delete the directory when run on a memfs Volume patched in with patchFs.

Both methods work when using a memfs Volume directly, just not with patchFs.

Only the rm and rmSync methods don't work. The rmdir and rmdirSync methods seem to work as intended with patchFs and an memfs Volume.

fs-monkey/src/util/lists.js doesn't contain rm or rmSync. I'm not sure whether they were left out intentionally for some reason, or if their absence really is a bug.

memfs-rm.js.txt

Missing files after npm install

Hey, I've tried to install this package, but none of the imports work. I've had a quick peak inside of the node_modules folder and this is the output:

➜  ts-quickfixes  git:(master) βœ— npm i -D fs-monkey
+ [email protected]
added 1 package and audited 2132 packages in 5.719s

121 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

                                                                                                 
➜  ts-quickfixes  git:(master) βœ— ls ./node_modules/fs-monkey    
CHANGELOG.md LICENSE      README.md    docs         package.json                                                                      

There don't seem to be any js files in there at all, whereas here's the output for v1.0.1

➜  ts-quickfixes  git:(master) βœ— npm i -D [email protected]   
+ [email protected]
updated 1 package and audited 2131 packages in 5.833s

121 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

                                                                                                 
➜  ts-quickfixes  git:(master) βœ— ls ./node_modules/fs-monkey
CHANGELOG.md LICENSE      README.md    docs         lib          package.json
                                                                                                 

Dependency deprecation warning: babel-preset-es2015 (npm)

On registry https://registry.npmjs.org/, the "latest" version (v6.24.1) of dependency babel-preset-es2015 has the following deprecation notice:

πŸ™Œ Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Affected package file(s): package.json

If you don't care about this, you can close this issue and not be warned about babel-preset-es2015's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:

"suppressNotifications": ["deprecationWarningIssues"]

patchFs doesn't work with memfs + fs using unionfs

In this example:

const { Union } = require('unionfs')
const { Volume } = require('memfs')
const fs = require('fs')
const { resolve } = require('path')
const { patchFs } = require('fs-monkey')

const test = resolve('test.txt')

const vol = Volume.fromJSON({
  '/foo': 'hello',
})

const ufs = new Union()

ufs
  .use(vol)
  .use(fs)

patchFs(ufs)

console.log(fs.readFileSync('/foo', 'utf8'))
console.log(fs.readFileSync(test, 'utf8'))

Logging the memfs file works, but logging the actual test.txt file doesn't work. The file is not found and only seems to look for it in the memfs volume. This works when not calling patchFs and using ufs instead of fs. Am I doing something wrong?

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two Factor Authentication for your account, set its level to "Authorization only" in your account settings. semantic-release cannot publish with the default "
Authorization and writes" level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Endless recursion when using `patchFs` with `unionfs`

The following code:

unionfs = require('unionfs')
ufs = unionfs.ufs
fs = require('fs')
ufs.use(fs)
fsMonkey = require('fs-monkey')
patchFs = fsMonkey.patchFs
patchFs(ufs)

fs.readdirSync('/')

gives the error:

…/node_modules/unionfs/lib/union.js:346
                        throw err;
                        ^

RangeError: Maximum call stack size exceeded
    at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:334:38)
    at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
    at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
    at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
    at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
    at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
    at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
    at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
    at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
    at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79) {
  prev: null
}

I presume the problem arises because fs is patched to use ufs, but that in turn is using fs? But the new fs should use ufs, while ufs should use the old fs? I guess that this sort of patching is quite fiddly and so there may be a gotcha here…

Thanks for fs-monkey!

show-and-tell: fs-require

First of all, thank you for your work on all these fs libraries @streamich. I use them in a lot of my libraries and they have saved me a lot of time and improved my DX.

I wanted to share a library I recently developed that might fit in well with the rest of your fs-suite: fs-require.

It's a localized version of fs-monkey for require()ing from a fs instance (eg. memfs). So instead of patching the global require(), it returns a new one that only reads from the given fs instance.

I am using it for testing a Webpack plugin by creating disposable fs instances using memfs and requiring the distribution code to see if it works.

If you'd like, I'd be happy to open a PR to add it to the "Reference" section in your README.md.

Support for Promises

I'm using the patchFS method in combination with unionfs / memfs, and while I get the expected result when using Sync / callback style methods, the fs.promises.X methods seem to be untouched. I'm guessing this is an oversight since the patching code ignores the promises object.

Example:

const Fs = require("fs");

const {ufs} = require("unionfs");
const {vol} = require("memfs");
const {patchFs} = require("fs-monkey");

const MockedFs = {"foo.bar": ""};

vol.fromJSON(MockedFs);

ufs.use({...require("fs")}).use(vol);
patchFs(ufs);

Fs.accessSync("foo.bar") // Undefined, aka accessible

Fs.promises.access("foo.bar").then(console.log).catch(console.error) // Fails, foo.bar not found

ufs.promises.access("foo.bar").then(console.log).catch(console.error) // As expected, doesnt error (Accessible)

unable to patch filesystem on node v12

I'm currently upgrading our services from node v8 to v12 and have encountered an issue in our tests. It appears this script - run as one of jest's setupFiles

import * as fs from 'fs';
import { patchFs } from 'fs-monkey';
import { Union } from 'unionfs';
import { vol as memfs } from 'memfs';
import configMap from './foo.config.json';

const volume = new Union();

memfs.fromJSON({
  '/var/foo.json': JSON.stringify(configMap),
});

// join the two volumes
volume.use(memfs).use(fs);

patchFs(volume);

is causing the error:

/home/alexandra/.config/versions/node/v12.16.3/bin/node[17860]: ../src/node_file.cc:1404:void node::fs::RealPath(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `(argc) >= (3)' failed.
 1: 0xa09830 node::Abort() [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 2: 0xa098ae  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 3: 0xa1693a  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 4: 0xbe96a9  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 5: 0xbeb497 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 6: 0x13c5c79  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
/home/alexandra/.config/versions/node/v12.16.3/bin/node[17867]: ../src/node_file.cc:1404:void node::fs::RealPath(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `(argc) >= (3)' failed.
 1: 0xa09830 node::Abort() [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 2: 0xa098ae  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 3: 0xa1693a  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 4: 0xbe96a9  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 5: 0xbeb497 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 6: 0x13c5c79  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
/home/alexandra/.config/versions/node/v12.16.3/bin/node[17878]: ../src/node_file.cc:1404:void node::fs::RealPath(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `(argc) >= (3)' failed.
 1: 0xa09830 node::Abort() [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 2: 0xa098ae  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 3: 0xa1693a  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 4: 0xbe96a9  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
/home/alexandra/.config/versions/node/v12.16.3/bin/node[17885]: ../src/node_file.cc:1404:void node::fs::RealPath(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `(argc) >= (3)' failed.
 5: 0xbeb497 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 1: 0xa09830 node::Abort() [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 2: 0xa098ae  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 6: 0x13c5c79  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 3: 0xa1693a  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 4: 0xbe96a9  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 5: 0xbeb497 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/home/alexandra/.config/versions/node/v12.16.3/bin/node]
 6: 0x13c5c79  [/home/alexandra/.config/versions/node/v12.16.3/bin/node]

Specifically, removing the line patchFs(volume) resolves the issue (and just causes the file system not to be patched).

Incompatible with package.json export(node 14+)

I found an issue that when I use CommonJS specification (such as axios version 1.3.0 or newer), pathRequire cannot be properly required. The reason is that Axios has declared export in package.json.

image

Looking forward to your reply.

Create a `./tmp` with `memfs` and have the rest of the file system still working

Last night I was quite tired for lack of sleeping but I had been tinkering for a few hours with patchFs, requireFs, memfs, unionfs, linkfs.
I went through a few errors with short stacktraces that took time to investigate.

The first attempt was just trying to use memfs. requires do not work anymore:

const fsMonkey = require('fs-monkey');
const vol = require('memfs').vol;
fsMonkey.patchFs(vol); //Tried patchRequire too

Realized that the goal was to create ./tmp with memfs:

  1. Attempt
const fsMonkey = require('fs-monkey');
const fs = require('fs');
const memfs = require('memfs').Volume.fromJSON({'./tmp/test.txt': 'dummy content '});
const ufs = require('unionfs').ufs;
ufs
  .use(fs) // if you switch the 2 `.use` you get different errors 
  .use(memfs)
fsMonkey.patchFs(ufs);
  1. Attempt:
const fsMonkey = require('fs-monkey');
const fs = require('fs');
const lfs = require('linkfs').link(fs, ['./tmp', 'tmpfs'])
const memfs = require('memfs').Volume.fromJSON({'tmpfs/test.txt': 'dummy content'});
const ufs = require('unionfs').ufs;
ufs
  .use(memfs)
  .use(lfs)
fsMonkey.patchFs(ufs);
  1. Attempt:
const fsMonkey = require('fs-monkey');
const fs = require('fs');
const memfs = require('memfs').Volume.fromJSON({'/tmpfs/test.txt': 'dummy content'});
const ufs = require('unionfs').ufs;
ufs
  .use(memfs)
  .use(fs)
const lfs = require('linkfs').link(ufs, ['./tmp', '/tmpfs'])

fsMonkey.patchFs(lfs);

How do you combine patchFs, requireFs, memfs, unionfs, linkfs so fs' calls everywhere in the app work seamlessly ?

I am sure if I try to solve this when I am rested I could make it quickly work. At the same time, the documentation could be a little more easy to find and cohesive. See: streamich/memfs#292

Setup automatic releases for CI & rename default branch

We used Travis for running CI which included doing automatic releases using semantic-release; that has stopped working at some point, so I've migrated us to GitHub Actions but need the NPM_TOKEN setup so that we can resume releases.

This has to be done by @streamich - could we also rename the default branch to main at the same time?

Add `unpatch` method

I want to use this in tests. It would be great to have a unpatch method for after tests have run.

patchFs could return a method to unpatch.

Or maybe patchfs(require('fs')) will work?

Dependency deprecation warning: babel-preset-es2015 (nvm)

On registry https://registry.npmjs.org/, the "latest" version (v6.24.1) of dependency babel-preset-es2015 has the following deprecation notice:

πŸ™Œ Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Please take the actions necessary to rename or substitute this deprecated package and commit to your base branch. If you wish to ignore this deprecation warning and continue using babel-preset-es2015 as-is, please add it to your ignoreDeps array in Renovate config before closing this issue, otherwise another issue will be recreated the next time Renovate runs.

Affected package file(s): package.json

BREAKING-CHANGE in release 1.0.0 affects dependencies in an undocumented way

fs-monkey is a devDependency of jaxom-ts, a typescript lib I'm building. The release was a breeaking change, but I'm not sure the nature of the breaking change. All I know is that my build on travis fails because of some internal import/export issue that breaks dependents. I use fs-monkey as a devDependency for mocha unit test and the change from 0.3.3 to 1.0.0 is at issue. The error is:

> [email protected] t /Users/Plastikfan/dev/github/js/jaxom-ts
> mocha

Error: Cannot find module './util/list'
Require stack:
- /Users/Plastikfan/dev/github/js/jaxom-ts/node_modules/fs-monkey/lib/index.js
- /Users/Plastikfan/dev/github/js/jaxom-ts/tests/cli/application.class.spec.ts
- /Users/Plastikfan/dev/github/js/jaxom-ts/node_modules/mocha/lib/mocha.js
- /Users/Plastikfan/dev/github/js/jaxom-ts/node_modules/mocha/lib/cli/one-and-dones.js
- /Users/Plastikfan/dev/github/js/jaxom-ts/node_modules/mocha/lib/cli/options.js
- /Users/Plastikfan/dev/github/js/jaxom-ts/node_modules/mocha/bin/mocha
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
    at Function.Module._load (internal/modules/cjs/loader.js:687:27)
...

Please can you document (or just let me know) the nature of the change and how it affects dependents. The infomation at https://github.com/streamich/fs-monkey/releases doesn't tell me what the breaking change is.

Here is my code showing the way I import and use fs-monkey.patchFs

import * as memfs from 'memfs';
import { patchFs } from 'fs-monkey';
import * as fs from 'fs';
...
const vol = memfs.vol;

const patchedFS = {
  writeFileSync: (path: fs.PathLike | number, data: any, options?: fs.WriteFileOptions): void => {
    throw new Error(`Something went wrong writing file to ${path}`);
  }
};

function setupFS (fileNames: string[], patch?: {}): memfs.IFs {

  const resultFS = R.reduce((acc: { [key: string]: any }, fileName: string): { [key: string]: any } => {
    const filePath = path.resolve(__dirname, fileName);
    const content: string = fs.readFileSync(filePath, 'utf8');
    return R.assoc(fileName, content)(acc);
  }, {})(fileNames);

  const volume = memfs.Volume.fromJSON(resultFS);
  if (patch) {
    patchFs(patch, volume); // <--- THIS INVOKES THE ERROR WHICH WORKED PRIOR TO BREAKING CHANGE
  }

  return memfs.createFsFromVolume(volume);
}
...

    context('given: error event occurring during write', () => {
      it('should: catch and report error', () => {
        mfs = setupFS(['./multiple-commands.content.xml', './test.parseInfo.all.json'],
          patchedFS); // <-- HERE IS THE USE OF PATCH

I've been looking at this since the release occurred and now I've reached the end of my tether, so any information you can give me would be most appreciated. I've never had a problem of an internal import/export breaking something externally, so this is new to me, cheers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.