Skip to content

Commit

Permalink
Merge branch 'main' into promise
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp authored Aug 2, 2022
2 parents c390573 + 37324cc commit 18a3c26
Show file tree
Hide file tree
Showing 61 changed files with 4,121 additions and 4,186 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- 12
- 14
- 16
- 18

steps:
- name: Clone repository
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/read-integration-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ const mock = require('..');
* test time.
* @param {function(Error)} done Callback.
*/
exports.test = function(done) {
exports.test = function (done) {
mock({
'foo-mock.txt': 'foo'
'foo-mock.txt': 'foo',
});

fs.readFile('foo-mock.txt', 'utf8', function(err, str) {
fs.readFile('foo-mock.txt', 'utf8', function (err, str) {
assert.ifError(err);
assert.equal(str, 'foo');

Expand Down
8 changes: 4 additions & 4 deletions benchmarks/read-integration-real.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const tmpPath = '.tmp';
* test time.
* @param {function(Error)} done Callback.
*/
exports.test = function(done) {
fs.mkdir(tmpPath, function(mkdirErr) {
exports.test = function (done) {
fs.mkdir(tmpPath, function (mkdirErr) {
assert.ifError(mkdirErr);
const tmpFile = path.join(tmpPath, 'foo-real.txt');
fs.writeFile(tmpFile, 'foo', function(writeErr) {
fs.writeFile(tmpFile, 'foo', function (writeErr) {
assert.ifError(writeErr);
fs.readFile(tmpFile, 'utf8', function(readErr, str) {
fs.readFile(tmpFile, 'utf8', function (readErr, str) {
assert.ifError(readErr);
assert.equal(str, 'foo');
rimraf(tmpPath, done);
Expand Down
10 changes: 5 additions & 5 deletions benchmarks/read-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ const mock = require('..');
/**
* Test setup. Not timed.
*/
exports.beforeEach = function() {
exports.beforeEach = function () {
mock({
'foo-mock.txt': 'foo'
'foo-mock.txt': 'foo',
});
};

/**
* Timed test.
* @param {function(Error)} done Callback.
*/
exports.test = function(done) {
fs.readFile('foo-mock.txt', 'utf8', function(err, str) {
exports.test = function (done) {
fs.readFile('foo-mock.txt', 'utf8', function (err, str) {
assert.ifError(err);
assert.equal(str, 'foo');
done();
Expand All @@ -27,6 +27,6 @@ exports.test = function(done) {
/**
* Test teardown. Not timed.
*/
exports.afterEach = function() {
exports.afterEach = function () {
mock.restore();
};
10 changes: 5 additions & 5 deletions benchmarks/read-real.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const tmpPath = '.tmp';
* Test setup. Not timed.
* @param {function(Error)} done Callback.
*/
exports.beforeEach = function(done) {
fs.mkdir(tmpPath, function(err) {
exports.beforeEach = function (done) {
fs.mkdir(tmpPath, function (err) {
if (err) {
return done(err);
}
Expand All @@ -23,8 +23,8 @@ exports.beforeEach = function(done) {
* Timed test.
* @param {function(Error)} done Callback.
*/
exports.test = function(done) {
fs.readFile(path.join(tmpPath, 'foo-real.txt'), 'utf8', function(err, str) {
exports.test = function (done) {
fs.readFile(path.join(tmpPath, 'foo-real.txt'), 'utf8', function (err, str) {
assert.ifError(err);
assert.equal(str, 'foo');
done();
Expand All @@ -35,6 +35,6 @@ exports.test = function(done) {
* Test teardown. Not timed.
* @param {function(Error)} done Callback.
*/
exports.afterEach = function(done) {
exports.afterEach = function (done) {
rimraf(tmpPath, done);
};
4 changes: 2 additions & 2 deletions benchmarks/write-integration-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const mock = require('..');
* test time.
* @param {function(Error)} done Callback.
*/
exports.test = function(done) {
exports.test = function (done) {
mock();

fs.writeFile('foo-mock.txt', 'foo', function(err) {
fs.writeFile('foo-mock.txt', 'foo', function (err) {
assert.ifError(err);

mock.restore();
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/write-integration-real.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const tmpPath = '.tmp';
* test time.
* @param {function(Error)} done Callback.
*/
exports.test = function(done) {
fs.mkdir(tmpPath, function(mkdirErr) {
exports.test = function (done) {
fs.mkdir(tmpPath, function (mkdirErr) {
assert.ifError(mkdirErr);
fs.writeFile(path.join(tmpPath, 'foo-real.txt'), 'foo', function(err) {
fs.writeFile(path.join(tmpPath, 'foo-real.txt'), 'foo', function (err) {
assert.ifError(err);
rimraf(tmpPath, done);
});
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/write-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ const mock = require('..');
/**
* Test setup. Not timed.
*/
exports.beforeEach = function() {
exports.beforeEach = function () {
mock();
};

/**
* Timed test.
* @param {function(Error)} done Callback.
*/
exports.test = function(done) {
exports.test = function (done) {
fs.writeFile('foo-mock.txt', 'foo', done);
};

/**
* Test teardown. Not timed.
*/
exports.afterEach = function() {
exports.afterEach = function () {
mock.restore();
};
6 changes: 3 additions & 3 deletions benchmarks/write-real.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ const tmpPath = '.tmp';
* Test setup. Not timed.
* @param {function(Error)} done Callback.
*/
exports.beforeEach = function(done) {
exports.beforeEach = function (done) {
fs.mkdir(tmpPath, done);
};

/**
* Timed test.
* @param {function(Error)} done Callback.
*/
exports.test = function(done) {
exports.test = function (done) {
fs.writeFile(path.join(tmpPath, 'foo-real.txt'), 'foo', done);
};

/**
* Test teardown. Not timed.
* @param {function(Error)} done Callback.
*/
exports.afterEach = function(done) {
exports.afterEach = function (done) {
rimraf(tmpPath, done);
};
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 5.1.3

* Fix for BigInt stats in Node 18.7 (thanks @3cp, see [#361][#361])

## 5.1.2

* Avoid open `FSREQCALLBACK` file handles (thanks @jloleysens, see [#342][#342])
Expand Down Expand Up @@ -334,3 +338,4 @@ Detailed changes:
[#335]: https://github.com/tschaub/mock-fs/pull/335
[#337]: https://github.com/tschaub/mock-fs/pull/337
[#342]: https://github.com/tschaub/mock-fs/pull/342
[#361]: https://github.com/tschaub/mock-fs/pull/361
Loading

0 comments on commit 18a3c26

Please sign in to comment.