Comparing version 5.0.0 to 5.1.0-dev.1631911363563
@@ -9,3 +9,3 @@ 'use strict'; | ||
const SymbolicLink = require('./symlink'); | ||
const FSError = require('./error'); | ||
const {FSError} = require('./error'); | ||
const constants = require('constants'); | ||
@@ -12,0 +12,0 @@ const getPathParts = require('./filesystem').getPathParts; |
@@ -44,4 +44,20 @@ 'use strict'; | ||
/** | ||
* Error constructor. | ||
* Create an abort error for when an asynchronous task was aborted. | ||
* @constructor | ||
*/ | ||
exports = module.exports = FSError; | ||
function AbortError() { | ||
Error.call(this); | ||
this.code = 'ABORT_ERR'; | ||
this.name = 'AbortError'; | ||
Error.captureStackTrace(this, AbortError); | ||
} | ||
AbortError.prototype = new Error(); | ||
/** | ||
* FSError constructor. | ||
*/ | ||
exports.FSError = FSError; | ||
/** | ||
* AbortError constructor. | ||
*/ | ||
exports.AbortError = AbortError; |
@@ -8,3 +8,3 @@ 'use strict'; | ||
const File = require('./file'); | ||
const FSError = require('./error'); | ||
const {FSError} = require('./error'); | ||
const SymbolicLink = require('./symlink'); | ||
@@ -11,0 +11,0 @@ |
'use strict'; | ||
const Binding = require('./binding'); | ||
const FSError = require('./error'); | ||
const {FSError} = require('./error'); | ||
const FileSystem = require('./filesystem'); | ||
@@ -10,2 +10,6 @@ const realBinding = process.binding('fs'); | ||
const bypass = require('./bypass'); | ||
const { | ||
getReadFileContextPrototype, | ||
patchReadFileContext | ||
} = require('./readfilecontext'); | ||
const fs = require('fs'); | ||
@@ -54,2 +58,6 @@ | ||
const readFileContextPrototype = getReadFileContextPrototype(); | ||
patchReadFileContext(readFileContextPrototype); | ||
function overrideBinding(binding) { | ||
@@ -99,2 +107,6 @@ realBinding._mockedBinding = binding; | ||
function overrideReadFileContext(binding) { | ||
readFileContextPrototype._mockedBinding = binding; | ||
} | ||
function restoreBinding() { | ||
@@ -116,2 +128,6 @@ delete realBinding._mockedBinding; | ||
function restoreReadFileContext(binding) { | ||
delete readFileContextPrototype._mockedBinding; | ||
} | ||
/** | ||
@@ -132,2 +148,4 @@ * Swap out the fs bindings for a mock file system. | ||
overrideReadFileContext(binding); | ||
let currentPath = process.cwd(); | ||
@@ -175,2 +193,3 @@ overrideProcess( | ||
restoreCreateWriteStream(); | ||
restoreReadFileContext(); | ||
}; | ||
@@ -177,0 +196,0 @@ |
{ | ||
"name": "mock-fs", | ||
"description": "A configurable mock file system. You know, for testing.", | ||
"version": "5.0.0", | ||
"version": "5.1.0-dev.1631911363563", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/tschaub/mock-fs", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2664
95757
1
3