| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 30b22a6 commit fbc189b
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,15 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + // Monkey patch the os binding before requiring any other modules, including | ||
| 3 | + // common, which requires the os module. | ||
| 4 | + process.binding('os').getHomeDirectory = function(ctx) { | ||
| 5 | + ctx.syscall = 'foo'; | ||
| 6 | + ctx.code = 'bar'; | ||
| 7 | + ctx.message = 'baz'; | ||
| 8 | + }; | ||
| 9 | + | ||
| 10 | + const common = require('../common'); | ||
| 11 | + const os = require('os'); | ||
| 12 | + | ||
| 13 | + common.expectsError(os.homedir, { | ||
| 14 | + message: /^A system error occurred: foo returned bar \(baz\)$/ | ||
| 15 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments