Skip to content

Commit e6eedae

Browse files
authored
test: update internal module references and add flags for tests
1 parent 329d0a0 commit e6eedae

23 files changed

Lines changed: 48 additions & 23 deletions

benchmark/http/check_invalid_header_char.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const common = require('../common.js');
4+
// TODO: benchmark has access to internal modules?
45
const _checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar;
56

67
const groupedInputs = {

benchmark/http/check_is_http_token.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const common = require('../common.js');
4+
// TODO: benchmark has access to internal modules?
45
const _checkIsHttpToken = require('_http_common')._checkIsHttpToken;
56

67
const bench = common.createBenchmark(main, {

benchmark/http/set_header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
const common = require('../common.js');
4-
const { OutgoingMessage } = require('_http_outgoing');
4+
const { OutgoingMessage } = require('http');
55

66
const bench = common.createBenchmark(main, {
77
value: [

test/async-hooks/test-httpparser.request.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Flags: --expose-internals --no-warnings
2+
13
'use strict';
24

35
const common = require('../common');
@@ -9,7 +11,7 @@ const { checkInvocations } = require('./hook-checks');
911
const hooks = initHooks();
1012
hooks.enable();
1113

12-
const { HTTPParser } = require('_http_common');
14+
const { HTTPParser } = require('internal/http/common');
1315

1416
const REQUEST = HTTPParser.REQUEST;
1517

test/async-hooks/test-httpparser.response.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Flags: --expose-internals --no-warnings
2+
13
'use strict';
24

35
const common = require('../common');
@@ -10,7 +12,7 @@ const hooks = initHooks();
1012

1113
hooks.enable();
1214

13-
const { HTTPParser } = require('_http_common');
15+
const { HTTPParser } = require('internal/http/common');
1416

1517
const RESPONSE = HTTPParser.RESPONSE;
1618
const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;

test/parallel/test-http-agent-keepalive-delay.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const common = require('../common');
44
const assert = require('assert');
55
const http = require('http');
6-
const { Agent } = require('_http_agent');
6+
const { Agent } = require('http');
77

88
const agent = new Agent({
99
keepAlive: true,

test/parallel/test-http-agent-keepalive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
const common = require('../common');
2424
const assert = require('assert');
2525
const http = require('http');
26-
const Agent = require('_http_agent').Agent;
26+
const Agent = require('http').Agent;
2727

2828
let name;
2929

test/parallel/test-http-common.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
// Flags: --expose-internals --no-warnings
2+
13
'use strict';
24
require('../common');
35
const assert = require('assert');
4-
const httpCommon = require('_http_common');
6+
const httpCommon = require('internal/http/common');
57
const checkIsHttpToken = httpCommon._checkIsHttpToken;
68
const checkInvalidHeaderChar = httpCommon._checkInvalidHeaderChar;
79

test/parallel/test-http-invalidheaderfield2.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
// Flags: --expose-internals --no-warnings
2+
13
'use strict';
24
require('../common');
35
const assert = require('assert');
46
const inspect = require('util').inspect;
5-
const { _checkIsHttpToken, _checkInvalidHeaderChar } = require('_http_common');
7+
const { _checkIsHttpToken, _checkInvalidHeaderChar } = require('internal/http/common');
68

79
// Good header field names
810
[

test/parallel/test-http-parser-bad-ref.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// Run this program with valgrind or efence with --expose_gc to expose the
33
// problem.
44

5-
// Flags: --expose_gc
5+
// Flags: --expose_gc --expose-internals --no-warnings
66

77
require('../common');
88
const assert = require('assert');
9-
const { HTTPParser } = require('_http_common');
9+
const { HTTPParser } = require('internal/http/common');
1010

1111
const kOnHeaders = HTTPParser.kOnHeaders | 0;
1212
const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;

0 commit comments

Comments
 (0)