Skip to content

Commit 783304b

Browse files
format
1 parent 50a194a commit 783304b

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

packages/angular/build/src/utils/debug-id_spec.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,15 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import {
10-
generateDebugId,
11-
injectDebugIdIntoJs,
12-
injectDebugIdIntoSourceMap,
13-
} from './debug-id';
9+
import { generateDebugId, injectDebugIdIntoJs, injectDebugIdIntoSourceMap } from './debug-id';
1410

1511
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
1612

1713
describe('debug-id', () => {
1814
describe('generateDebugId', () => {
1915
it('produces a canonical UUIDv5 string', () => {
2016
expect(generateDebugId('hello')).toMatch(UUID);
21-
expect(generateDebugId(new TextEncoder().encode('hello'))).toMatch(
22-
UUID,
23-
);
17+
expect(generateDebugId(new TextEncoder().encode('hello'))).toMatch(UUID);
2418
});
2519

2620
it('is deterministic for identical inputs', () => {
@@ -56,7 +50,8 @@ describe('debug-id', () => {
5650
});
5751

5852
it('replaces an existing debugId comment (idempotent)', () => {
59-
const original = 'console.log(1);\n//# debugId=00000000-0000-5000-8000-000000000000\n//# sourceMappingURL=foo.js.map\n';
53+
const original =
54+
'console.log(1);\n//# debugId=00000000-0000-5000-8000-000000000000\n//# sourceMappingURL=foo.js.map\n';
6055
const result = injectDebugIdIntoJs(original, id);
6156
expect(result).toBe(
6257
'console.log(1);\n//# debugId=11111111-2222-5333-9444-555555555555\n//# sourceMappingURL=foo.js.map\n',
@@ -83,7 +78,8 @@ describe('debug-id', () => {
8378
});
8479

8580
it('returns the original input when debugId already matches', () => {
86-
const map = '{\n "version": 3,\n "debugId": "11111111-2222-5333-9444-555555555555",\n "mappings": ""\n}';
81+
const map =
82+
'{\n "version": 3,\n "debugId": "11111111-2222-5333-9444-555555555555",\n "mappings": ""\n}';
8783
expect(injectDebugIdIntoSourceMap(map, id)).toBe(map);
8884
});
8985

0 commit comments

Comments
 (0)