This repository has been archived by the owner on Oct 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix plugin require in tests in iojs 2.2.x
See tschaub/mock-fs#43 Either way, it's nice to have the test plugins as standalone files for syntax highlighting purposes.
- Loading branch information
1 parent
b1ccef9
commit eb79b94
Showing
8 changed files
with
93 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
process: function(config, file, callback) { | ||
file.path += ".bak"; | ||
callback(undefined, file); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
process: function(config, file, callback) { | ||
var file2 = { | ||
path: file.path + ".bak", | ||
stats: file.stats, | ||
data: file.data | ||
}; | ||
callback(undefined, [file, file2]); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"use strict"; | ||
|
||
var mockFs = require("mock-fs"); | ||
|
||
/* | ||
* We need to mock the filesystem in the first plugin because iojs 2.2.x made a change | ||
* that breaks mock-fs's mocking behavior for the "require" method. | ||
* https://github.com/tschaub/mock-fs/issues/43 | ||
* This lets the real require work against the filesystem, and the rest of the test operate against the mock filesystem. | ||
* It's a bit strange, but it works. | ||
*/ | ||
module.exports = { | ||
init: function(config, callback) { | ||
mockFs(config.fs); | ||
callback(undefined, config); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
process: function(config, file, callback) { | ||
file.data = "yolo"; | ||
callback(undefined, file); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters