blob: 2a393f830d4b76d4de19084cc92554009a06ac8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
'use strict';
// Flags: --expose_internals
const { internalBinding } = require('internal/test/binding');
// Monkey patch the os binding before requiring any other modules, including
// common, which requires the os module.
internalBinding('os').getHomeDirectory = function(ctx) {
ctx.syscall = 'foo';
ctx.code = 'bar';
ctx.message = 'baz';
};
const common = require('../common');
const os = require('os');
common.expectsError(os.homedir, {
message: /^A system error occurred: foo returned bar \(baz\)$/
});
|