|
2 | 2 |
|
3 | 3 | module Exceptionless { |
4 | 4 | describe('Utils', () => { |
5 | | - it('should parse version from url', () => { |
6 | | - expect(Utils.parseVersion('https://code.jquery.com/jquery-2.1.3.js')).toBe('2.1.3'); |
7 | | - expect(Utils.parseVersion('//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css')).toBe('3.3.4'); |
8 | | - expect(Utils.parseVersion('https://cdnjs.cloudflare.com/ajax/libs/1140/2.0/1140.css')).toBe('2.0'); |
9 | | - expect(Utils.parseVersion('https://cdnjs.cloudflare.com/ajax/libs/Base64/0.3.0/base64.min.js')).toBe('0.3.0'); |
10 | | - expect(Utils.parseVersion('https://cdnjs.cloudflare.com/ajax/libs/angular-google-maps/2.1.0-X.10/angular-google-maps.min.js')).toBe('2.1.0-X.10'); |
11 | | - expect(Utils.parseVersion('https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/2.1.8-M1/swagger-ui.min.js')).toBe('2.1.8-M1'); |
12 | | - expect(Utils.parseVersion('https://cdnjs.cloudflare.com/BLAH/BLAH.min.js')).toBe(null); |
13 | | - }); |
| 5 | + it('should stringify circular reference', () => { |
| 6 | + var afoo:any = { a: 'foo' }; |
| 7 | + afoo.b = afoo; |
| 8 | + |
| 9 | + expect(Utils.stringify(afoo)).toBe('{"a":"foo"}'); |
| 10 | + expect(Utils.stringify({ one: afoo, two: afoo })).toBe('{"one":{"a":"foo"}}'); |
| 11 | + }); |
| 12 | + |
| 13 | + it('should parse version from url', () => { |
| 14 | + expect(Utils.parseVersion('https://code.jquery.com/jquery-2.1.3.js')).toBe('2.1.3'); |
| 15 | + expect(Utils.parseVersion('//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css')).toBe('3.3.4'); |
| 16 | + expect(Utils.parseVersion('https://cdnjs.cloudflare.com/ajax/libs/1140/2.0/1140.css')).toBe('2.0'); |
| 17 | + expect(Utils.parseVersion('https://cdnjs.cloudflare.com/ajax/libs/Base64/0.3.0/base64.min.js')).toBe('0.3.0'); |
| 18 | + expect(Utils.parseVersion('https://cdnjs.cloudflare.com/ajax/libs/angular-google-maps/2.1.0-X.10/angular-google-maps.min.js')).toBe('2.1.0-X.10'); |
| 19 | + expect(Utils.parseVersion('https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/2.1.8-M1/swagger-ui.min.js')).toBe('2.1.8-M1'); |
| 20 | + expect(Utils.parseVersion('https://cdnjs.cloudflare.com/BLAH/BLAH.min.js')).toBe(null); |
| 21 | + }); |
14 | 22 | }); |
15 | 23 | } |
0 commit comments