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

@@ -1,73 +1,73 @@
describe('Any', function() {
it('matches a string', function() {
const any = new jasmineUnderTest.Any(String);
const any = new privateUnderTest.Any(String);
expect(any.asymmetricMatch('foo')).toBe(true);
});
it('matches a number', function() {
const any = new jasmineUnderTest.Any(Number);
const any = new privateUnderTest.Any(Number);
expect(any.asymmetricMatch(1)).toBe(true);
});
it('matches a function', function() {
const any = new jasmineUnderTest.Any(Function);
const any = new privateUnderTest.Any(Function);
expect(any.asymmetricMatch(function() {})).toBe(true);
});
it('matches an Object', function() {
const any = new jasmineUnderTest.Any(Object);
const any = new privateUnderTest.Any(Object);
expect(any.asymmetricMatch({})).toBe(true);
});
it('matches a Boolean', function() {
const any = new jasmineUnderTest.Any(Boolean);
const any = new privateUnderTest.Any(Boolean);
expect(any.asymmetricMatch(true)).toBe(true);
});
it('matches a Map', function() {
const any = new jasmineUnderTest.Any(Map);
const any = new privateUnderTest.Any(Map);
expect(any.asymmetricMatch(new Map())).toBe(true);
});
it('matches a Set', function() {
const any = new jasmineUnderTest.Any(Set);
const any = new privateUnderTest.Any(Set);
expect(any.asymmetricMatch(new Set())).toBe(true);
});
it('matches a TypedArray', function() {
const any = new jasmineUnderTest.Any(Uint32Array);
const any = new privateUnderTest.Any(Uint32Array);
expect(any.asymmetricMatch(new Uint32Array([]))).toBe(true);
});
it('matches a Symbol', function() {
const any = new jasmineUnderTest.Any(Symbol);
const any = new privateUnderTest.Any(Symbol);
expect(any.asymmetricMatch(Symbol())).toBe(true);
});
it('matches another constructed object', function() {
const Thing = function() {},
any = new jasmineUnderTest.Any(Thing);
any = new privateUnderTest.Any(Thing);
expect(any.asymmetricMatch(new Thing())).toBe(true);
});
it('does not treat null as an Object', function() {
const any = new jasmineUnderTest.Any(Object);
const any = new privateUnderTest.Any(Object);
expect(any.asymmetricMatch(null)).toBe(false);
});
it("jasmineToString's itself", function() {
const any = new jasmineUnderTest.Any(Number);
const any = new privateUnderTest.Any(Number);
expect(any.jasmineToString()).toEqual('<jasmine.any(Number)>');
expect(any.jasmineToString()).toEqual('<jasmine.any(Number)>');
@@ -76,7 +76,7 @@ describe('Any', function() {
describe('when called without an argument', function() {
it('tells the user to pass a constructor or use jasmine.anything()', function() {
expect(function() {
new jasmineUnderTest.Any();
new privateUnderTest.Any();
}).toThrowError(TypeError, /constructor.*anything/);
});
});