diff options
| author | Ken Sheedlo | 2013-08-13 15:30:52 -0700 |
|---|---|---|
| committer | Ken Sheedlo | 2013-08-15 13:23:18 -0700 |
| commit | 37123cd2858b4e318ed8109af745312df4848577 (patch) | |
| tree | 118abe5fd50e1c6fef4281972cf52c0162482fa8 /test/minErrSpec.js | |
| parent | fe267e30b95e8f48ddc670b97d485f18fb64d39e (diff) | |
| download | angular.js-37123cd2858b4e318ed8109af745312df4848577.tar.bz2 | |
feat(minerr): log minerr doc url in development
Closes #3566
Diffstat (limited to 'test/minErrSpec.js')
| -rw-r--r-- | test/minErrSpec.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/minErrSpec.js b/test/minErrSpec.js index 4ee569e0..6b7d93b8 100644 --- a/test/minErrSpec.js +++ b/test/minErrSpec.js @@ -1,12 +1,12 @@ 'use strict'; describe('minErr', function () { - + var supportStackTraces = function() { var e = new Error(); return isDefined(e.stack); }; - var emptyTestError = minErr(), + var emptyTestError = minErr(), testError = minErr('test'); it('should return an Error factory', function() { @@ -34,7 +34,7 @@ describe('minErr', function () { it('should interpolate string arguments without quotes', function() { var myError = testError('1', 'This {0} is "{1}"', 'foo', 'bar'); - expect(myError.message).toBe('[test:1] This foo is "bar"'); + expect(myError.message).toMatch(/^\[test:1\] This foo is "bar"/); }); it('should interpolate non-string arguments', function() { @@ -57,7 +57,7 @@ describe('minErr', function () { var myError = testError('26', 'false: {0}; zero: {1}; null: {2}; undefined: {3}; emptyStr: {4}', false, 0, null, undefined, ''); expect(myError.message). - toBe('[test:26] false: false; zero: 0; null: null; undefined: undefined; emptyStr: '); + toMatch(/^\[test:26\] false: false; zero: 0; null: null; undefined: undefined; emptyStr: /); }); @@ -67,19 +67,19 @@ describe('minErr', function () { var foo = 'Fooooo', myError = testError('26', 'This {0} is {1} on {2}', foo); - expect(myError.message).toBe('[test:26] This Fooooo is {1} on {2}'); + expect(myError.message).toMatch(/^\[test:26\] This Fooooo is \{1\} on \{2\}/); }); it('should pass through the message if no interpolation is needed', function() { var myError = testError('26', 'Something horrible happened!'); - expect(myError.message).toBe('[test:26] Something horrible happened!'); + expect(myError.message).toMatch(/^\[test:26\] Something horrible happened!/); }); it('should include a namespace in the message only if it is namespaced', function () { var myError = emptyTestError('26', 'This is a {0}', 'Foo'); var myNamespacedError = testError('26', 'That is a {0}', 'Bar'); - expect(myError.message).toBe('[26] This is a Foo'); - expect(myNamespacedError.message).toBe('[test:26] That is a Bar'); + expect(myError.message).toMatch(/^\[26\] This is a Foo/); + expect(myNamespacedError.message).toMatch(/^\[test:26\] That is a Bar/); }); }); |
