Move private APIs to private namespace

Fixes #2078
This commit is contained in:
Steve Gravrock
2025-09-27 13:21:09 -07:00
parent fbec066837
commit 168ff0a751
183 changed files with 2627 additions and 2459 deletions

View File

@@ -2,10 +2,10 @@ describe('toEqual', function() {
'use strict';
function compareEquals(actual, expected) {
const matchersUtil = new jasmineUnderTest.MatchersUtil({
pp: jasmineUnderTest.makePrettyPrinter()
const matchersUtil = new privateUnderTest.MatchersUtil({
pp: privateUnderTest.makePrettyPrinter()
}),
matcher = jasmineUnderTest.matchers.toEqual(matchersUtil);
matcher = privateUnderTest.matchers.toEqual(matchersUtil);
const result = matcher.compare(actual, expected);
@@ -18,9 +18,9 @@ describe('toEqual', function() {
buildFailureMessage: function() {
return 'does not matter';
},
DiffBuilder: new jasmineUnderTest.DiffBuilder()
DiffBuilder: new privateUnderTest.DiffBuilder()
},
matcher = jasmineUnderTest.matchers.toEqual(matchersUtil);
matcher = privateUnderTest.matchers.toEqual(matchersUtil);
const result = matcher.compare(1, 1);
@@ -32,10 +32,10 @@ describe('toEqual', function() {
const tester = function(a, b) {
return a.toString() === b.toString();
},
matchersUtil = new jasmineUnderTest.MatchersUtil({
matchersUtil = new privateUnderTest.MatchersUtil({
customTesters: [tester]
}),
matcher = jasmineUnderTest.matchers.toEqual(matchersUtil);
matcher = privateUnderTest.matchers.toEqual(matchersUtil);
const result = matcher.compare(1, '1');
@@ -148,9 +148,9 @@ describe('toEqual', function() {
const actual = { x: { y: 1, z: 2, f: 4 } },
expected = { x: { y: 1, z: 2, g: 3 } },
pp = jasmineUnderTest.makePrettyPrinter([formatter]),
matchersUtil = new jasmineUnderTest.MatchersUtil({ pp: pp }),
matcher = jasmineUnderTest.matchers.toEqual(matchersUtil),
pp = privateUnderTest.makePrettyPrinter([formatter]),
matchersUtil = new privateUnderTest.MatchersUtil({ pp: pp }),
matcher = privateUnderTest.matchers.toEqual(matchersUtil),
message =
'Expected $.x to have properties\n' +
' g: |3|\n' +
@@ -169,9 +169,9 @@ describe('toEqual', function() {
const actual = [{ foo: 4 }],
expected = [{ foo: 5 }],
prettyPrinter = jasmineUnderTest.makePrettyPrinter([formatter]),
matchersUtil = new jasmineUnderTest.MatchersUtil({ pp: prettyPrinter }),
matcher = jasmineUnderTest.matchers.toEqual(matchersUtil),
prettyPrinter = privateUnderTest.makePrettyPrinter([formatter]),
matchersUtil = new privateUnderTest.MatchersUtil({ pp: prettyPrinter }),
matcher = privateUnderTest.matchers.toEqual(matchersUtil),
message = 'Expected $[0].foo = |4| to equal |5|.';
expect(matcher.compare(actual, expected).message).toEqual(message);
@@ -196,9 +196,9 @@ describe('toEqual', function() {
bar: "shouldn't be pretty printed"
}
],
prettyPrinter = jasmineUnderTest.makePrettyPrinter([formatter]),
matchersUtil = new jasmineUnderTest.MatchersUtil({ pp: prettyPrinter }),
matcher = jasmineUnderTest.matchers.toEqual(matchersUtil),
prettyPrinter = privateUnderTest.makePrettyPrinter([formatter]),
matchersUtil = new privateUnderTest.MatchersUtil({ pp: prettyPrinter }),
matcher = privateUnderTest.matchers.toEqual(matchersUtil),
message =
'Expected $[0].foo = [thing with a=1, b=2] to equal [thing with a=5, b=2].\n' +
"Expected $[0].bar = 'should not be pretty printed' to equal 'shouldn't be pretty printed'.";
@@ -390,9 +390,9 @@ describe('toEqual', function() {
const actual = { x: new Foo() },
expected = { x: new Bar() },
message = 'Expected $.x to be a kind of Bar, but was |[object Object]|.',
pp = jasmineUnderTest.makePrettyPrinter([formatter]),
matchersUtil = new jasmineUnderTest.MatchersUtil({ pp: pp }),
matcher = jasmineUnderTest.matchers.toEqual(matchersUtil);
pp = privateUnderTest.makePrettyPrinter([formatter]),
matchersUtil = new privateUnderTest.MatchersUtil({ pp: pp }),
matcher = privateUnderTest.matchers.toEqual(matchersUtil);
expect(matcher.compare(actual, expected).message).toEqual(message);
});
@@ -939,9 +939,9 @@ describe('toEqual', function() {
const actual = [1, 1, 2, 3, 5],
expected = [1, 1, 2, 3],
pp = jasmineUnderTest.makePrettyPrinter([formatter]),
matchersUtil = new jasmineUnderTest.MatchersUtil({ pp: pp }),
matcher = jasmineUnderTest.matchers.toEqual(matchersUtil),
pp = privateUnderTest.makePrettyPrinter([formatter]),
matchersUtil = new privateUnderTest.MatchersUtil({ pp: pp }),
matcher = privateUnderTest.matchers.toEqual(matchersUtil),
message =
'Expected $.length = |5| to equal |4|.\n' +
'Unexpected $[4] = |5| in array.';