@fluid-experimental/property-changeset 0.59.2001 → 0.59.3000
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/changeset.d.ts.map +1 -1
- package/dist/changeset.js +50 -50
- package/dist/changeset.js.map +1 -1
- package/dist/changeset_operations/array.d.ts.map +1 -1
- package/dist/changeset_operations/array.js +22 -22
- package/dist/changeset_operations/array.js.map +1 -1
- package/dist/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
- package/dist/changeset_operations/arrayChangesetIterator.js +3 -3
- package/dist/changeset_operations/arrayChangesetIterator.js.map +1 -1
- package/dist/changeset_operations/indexedCollection.js +21 -21
- package/dist/changeset_operations/indexedCollection.js.map +1 -1
- package/dist/changeset_operations/isEmptyChangeset.js +2 -2
- package/dist/changeset_operations/isEmptyChangeset.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pathHelper.js.map +1 -1
- package/dist/rebase.js +6 -6
- package/dist/rebase.js.map +1 -1
- package/dist/templateSchema.d.ts.map +1 -1
- package/dist/templateSchema.js +1 -0
- package/dist/templateSchema.js.map +1 -1
- package/dist/templateValidator.d.ts.map +1 -1
- package/dist/templateValidator.js +32 -32
- package/dist/templateValidator.js.map +1 -1
- package/dist/test/array.spec.js +40 -40
- package/dist/test/array.spec.js.map +1 -1
- package/dist/test/pathHelper.spec.js +147 -147
- package/dist/test/pathHelper.spec.js.map +1 -1
- package/dist/test/reversibleCs.spec.js +2 -2
- package/dist/test/reversibleCs.spec.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +1 -1660
- package/dist/test/validator/templateSyntax.spec.js +29 -29
- package/dist/test/validator/templateSyntax.spec.js.map +1 -1
- package/dist/test/validator/templateValidator.spec.js +202 -202
- package/dist/test/validator/templateValidator.spec.js.map +1 -1
- package/dist/test/validator/typeidHelper.spec.js +39 -39
- package/dist/test/validator/typeidHelper.spec.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +41 -41
- package/dist/utils.js.map +1 -1
- package/lib/changeset.js.map +1 -1
- package/lib/changeset_operations/array.js.map +1 -1
- package/lib/changeset_operations/arrayChangesetIterator.js.map +1 -1
- package/lib/changeset_operations/indexedCollection.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/pathHelper.js.map +1 -1
- package/lib/rebase.js.map +1 -1
- package/lib/templateSchema.js +1 -0
- package/lib/templateSchema.js.map +1 -1
- package/lib/templateValidator.js +1 -1
- package/lib/templateValidator.js.map +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +4 -4
|
@@ -15,233 +15,233 @@ describe('PathHelper', function () {
|
|
|
15
15
|
describe('tokenizePathString', function () {
|
|
16
16
|
it('should work for simple paths separated by dots', function () {
|
|
17
17
|
let types = [];
|
|
18
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('', types)).to.deep.equal([]);
|
|
19
|
-
chai_1.expect(types).to.deep.equal([]);
|
|
20
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('test', types)).to.deep.equal(['test']);
|
|
21
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
22
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('test.test2', types)).to.deep.equal(['test', 'test2']);
|
|
23
|
-
chai_1.expect(types).to.deep.equal([
|
|
18
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('', types)).to.deep.equal([]);
|
|
19
|
+
(0, chai_1.expect)(types).to.deep.equal([]);
|
|
20
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('test', types)).to.deep.equal(['test']);
|
|
21
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
22
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('test.test2', types)).to.deep.equal(['test', 'test2']);
|
|
23
|
+
(0, chai_1.expect)(types).to.deep.equal([
|
|
24
24
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
25
25
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
26
26
|
]);
|
|
27
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('.test2'); }).to.throw();
|
|
28
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('test2.'); }).to.throw();
|
|
29
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('.'); }).to.throw();
|
|
27
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('.test2'); }).to.throw();
|
|
28
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('test2.'); }).to.throw();
|
|
29
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('.'); }).to.throw();
|
|
30
30
|
});
|
|
31
31
|
it('should work for arrays', function () {
|
|
32
32
|
let types = [];
|
|
33
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('[test]', types)).to.deep.equal(['test']);
|
|
34
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
35
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('[test][test2]', types)).to.deep.equal(['test', 'test2']);
|
|
36
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
37
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('['); }).to.throw();
|
|
38
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('[abcd'); }).to.throw();
|
|
39
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString(']'); }).to.throw();
|
|
40
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('[abcd]]'); }).to.throw();
|
|
41
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('[]'); }).to.throw();
|
|
33
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('[test]', types)).to.deep.equal(['test']);
|
|
34
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
35
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('[test][test2]', types)).to.deep.equal(['test', 'test2']);
|
|
36
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
37
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('['); }).to.throw();
|
|
38
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('[abcd'); }).to.throw();
|
|
39
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString(']'); }).to.throw();
|
|
40
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('[abcd]]'); }).to.throw();
|
|
41
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('[]'); }).to.throw();
|
|
42
42
|
});
|
|
43
43
|
it('should work for combinations of arrays and paths separated by dots', function () {
|
|
44
44
|
let types = [];
|
|
45
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('map[test]', types)).to.deep.equal(['map', 'test']);
|
|
46
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
47
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('[test].parameter', types)).to.deep.equal(['test', 'parameter']);
|
|
48
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
49
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('map[test].parameter[test2]', types)).to.deep.equal(['map', 'test', 'parameter', 'test2']);
|
|
50
|
-
chai_1.expect(types).to.deep.equal([
|
|
45
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('map[test]', types)).to.deep.equal(['map', 'test']);
|
|
46
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
47
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('[test].parameter', types)).to.deep.equal(['test', 'parameter']);
|
|
48
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
49
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('map[test].parameter[test2]', types)).to.deep.equal(['map', 'test', 'parameter', 'test2']);
|
|
50
|
+
(0, chai_1.expect)(types).to.deep.equal([
|
|
51
51
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
52
52
|
pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
|
|
53
53
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
54
54
|
pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
|
|
55
55
|
]);
|
|
56
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('[test]parameter'); }).to.throw();
|
|
56
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('[test]parameter'); }).to.throw();
|
|
57
57
|
});
|
|
58
58
|
it('should work for quoted tokens', function () {
|
|
59
59
|
let types = [];
|
|
60
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('"test"', types)).to.deep.equal(['test']);
|
|
61
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
62
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('"te\\"st"', types)).to.deep.equal(['te"st']);
|
|
63
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
64
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('"te\\\\st"', types)).to.deep.equal(['te\\st']);
|
|
65
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
66
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('""', types)).to.deep.equal(['']);
|
|
67
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
68
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('"test1".test2', types)).to.deep.equal(['test1', 'test2']);
|
|
69
|
-
chai_1.expect(types).to.deep.equal([
|
|
60
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"test"', types)).to.deep.equal(['test']);
|
|
61
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
62
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"te\\"st"', types)).to.deep.equal(['te"st']);
|
|
63
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
64
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"te\\\\st"', types)).to.deep.equal(['te\\st']);
|
|
65
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
66
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('""', types)).to.deep.equal(['']);
|
|
67
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
68
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"test1".test2', types)).to.deep.equal(['test1', 'test2']);
|
|
69
|
+
(0, chai_1.expect)(types).to.deep.equal([
|
|
70
70
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
71
71
|
]);
|
|
72
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('"test1"."test2"', types)).to.deep.equal(['test1', 'test2']);
|
|
73
|
-
chai_1.expect(types).to.deep.equal([
|
|
72
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"test1"."test2"', types)).to.deep.equal(['test1', 'test2']);
|
|
73
|
+
(0, chai_1.expect)(types).to.deep.equal([
|
|
74
74
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
75
75
|
]);
|
|
76
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('test1."test2"', types)).to.deep.equal(['test1', 'test2']);
|
|
77
|
-
chai_1.expect(types).to.deep.equal([
|
|
76
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('test1."test2"', types)).to.deep.equal(['test1', 'test2']);
|
|
77
|
+
(0, chai_1.expect)(types).to.deep.equal([
|
|
78
78
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
79
79
|
]);
|
|
80
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('test1["test2"]', types)).to.deep.equal(['test1', 'test2']);
|
|
81
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
82
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('"test1"["test2"]', types)).to.deep.equal(['test1', 'test2']);
|
|
83
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
84
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('""[""]', types)).to.deep.equal(['', '']);
|
|
85
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
86
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('"/"', types)).to.deep.equal(['/']);
|
|
87
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
88
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('/', types)).to.deep.equal(['/']);
|
|
89
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN]);
|
|
90
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('/test', types)).to.deep.equal(['/', 'test']);
|
|
91
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
92
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('/[test]', types)).to.deep.equal(['/', 'test']);
|
|
93
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
94
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('*', types)).to.deep.equal(['*']);
|
|
95
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN]);
|
|
96
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('test*', types)).to.deep.equal(['test', '*']);
|
|
97
|
-
chai_1.expect(types).to.deep.equal([
|
|
80
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('test1["test2"]', types)).to.deep.equal(['test1', 'test2']);
|
|
81
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
82
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"test1"["test2"]', types)).to.deep.equal(['test1', 'test2']);
|
|
83
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
84
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('""[""]', types)).to.deep.equal(['', '']);
|
|
85
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
86
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('"/"', types)).to.deep.equal(['/']);
|
|
87
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
88
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('/', types)).to.deep.equal(['/']);
|
|
89
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN]);
|
|
90
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('/test', types)).to.deep.equal(['/', 'test']);
|
|
91
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN]);
|
|
92
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('/[test]', types)).to.deep.equal(['/', 'test']);
|
|
93
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
94
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('*', types)).to.deep.equal(['*']);
|
|
95
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN]);
|
|
96
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('test*', types)).to.deep.equal(['test', '*']);
|
|
97
|
+
(0, chai_1.expect)(types).to.deep.equal([
|
|
98
98
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
|
|
99
99
|
]);
|
|
100
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('*.test', types)).to.deep.equal(['*', 'test']);
|
|
101
|
-
chai_1.expect(types).to.deep.equal([
|
|
100
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('*.test', types)).to.deep.equal(['*', 'test']);
|
|
101
|
+
(0, chai_1.expect)(types).to.deep.equal([
|
|
102
102
|
pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
103
103
|
]);
|
|
104
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('*test', types); }).to.throw();
|
|
105
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('test*test', types); }).to.throw();
|
|
106
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('*.test*.test2*', types)).to.deep.equal(['*', 'test', '*', 'test2', '*']);
|
|
107
|
-
chai_1.expect(types).to.deep.equal([
|
|
104
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('*test', types); }).to.throw();
|
|
105
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('test*test', types); }).to.throw();
|
|
106
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('*.test*.test2*', types)).to.deep.equal(['*', 'test', '*', 'test2', '*']);
|
|
107
|
+
(0, chai_1.expect)(types).to.deep.equal([
|
|
108
108
|
pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
|
|
109
109
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
110
110
|
pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
|
|
111
111
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
112
112
|
pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
|
|
113
113
|
]);
|
|
114
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('/*', types)).to.deep.equal(['/', '*']);
|
|
115
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN]);
|
|
116
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('*[test]', types)).to.deep.equal(['*', 'test']);
|
|
117
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
118
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('[test]*', types)).to.deep.equal(['test', '*']);
|
|
119
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN]);
|
|
120
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('[test]*.test2', types)).to.deep.equal(['test', '*', 'test2']);
|
|
121
|
-
chai_1.expect(types).to.deep.equal([
|
|
114
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('/*', types)).to.deep.equal(['/', '*']);
|
|
115
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN]);
|
|
116
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('*[test]', types)).to.deep.equal(['*', 'test']);
|
|
117
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN]);
|
|
118
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('[test]*', types)).to.deep.equal(['test', '*']);
|
|
119
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN]);
|
|
120
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('[test]*.test2', types)).to.deep.equal(['test', '*', 'test2']);
|
|
121
|
+
(0, chai_1.expect)(types).to.deep.equal([
|
|
122
122
|
pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
|
|
123
123
|
pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
|
|
124
124
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
125
125
|
]);
|
|
126
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('[test]*[test2]', types)).to.deep.equal(['test', '*', 'test2']);
|
|
127
|
-
chai_1.expect(types).to.deep.equal([
|
|
126
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('[test]*[test2]', types)).to.deep.equal(['test', '*', 'test2']);
|
|
127
|
+
(0, chai_1.expect)(types).to.deep.equal([
|
|
128
128
|
pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
|
|
129
129
|
pathHelper_1.PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN,
|
|
130
130
|
pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
|
|
131
131
|
]);
|
|
132
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('[test]*test', types); }).to.throw();
|
|
133
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('"'); }).to.throw();
|
|
134
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('test"'); }).to.throw();
|
|
135
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('"tests'); }).to.throw();
|
|
136
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('"\\a"'); }).to.throw();
|
|
132
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('[test]*test', types); }).to.throw();
|
|
133
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('"'); }).to.throw();
|
|
134
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('test"'); }).to.throw();
|
|
135
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('"tests'); }).to.throw();
|
|
136
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('"\\a"'); }).to.throw();
|
|
137
137
|
});
|
|
138
138
|
it('should work for relative paths', function () {
|
|
139
139
|
let types = [];
|
|
140
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('../test', types)).to.deep.equal(['../', 'test']);
|
|
141
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
|
|
140
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('../test', types)).to.deep.equal(['../', 'test']);
|
|
141
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
|
|
142
142
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
143
143
|
]);
|
|
144
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('../../../test', types)).to.deep.equal(['../', '../', '../', 'test']);
|
|
145
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
|
|
144
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('../../../test', types)).to.deep.equal(['../', '../', '../', 'test']);
|
|
145
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
|
|
146
146
|
pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN,
|
|
147
147
|
]);
|
|
148
|
-
chai_1.expect(pathHelper_1.PathHelper.tokenizePathString('../../test[0].test2[key]', types)).to.deep.equal(['../', '../', 'test', '0', 'test2', 'key']);
|
|
149
|
-
chai_1.expect(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
|
|
148
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.tokenizePathString('../../test[0].test2[key]', types)).to.deep.equal(['../', '../', 'test', '0', 'test2', 'key']);
|
|
149
|
+
(0, chai_1.expect)(types).to.deep.equal([pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN,
|
|
150
150
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
|
|
151
151
|
pathHelper_1.PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN, pathHelper_1.PathHelper.TOKEN_TYPES.ARRAY_TOKEN,
|
|
152
152
|
]);
|
|
153
|
-
chai_1.expect(function () { pathHelper_1.PathHelper.tokenizePathString('/../test2'); }).to.throw();
|
|
153
|
+
(0, chai_1.expect)(function () { pathHelper_1.PathHelper.tokenizePathString('/../test2'); }).to.throw();
|
|
154
154
|
});
|
|
155
155
|
});
|
|
156
156
|
describe('quotePathSegment', function () {
|
|
157
157
|
it('should quote simple strings', function () {
|
|
158
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegment('test')).to.equal('"test"');
|
|
159
|
-
chai_1.expect(JSON.parse(pathHelper_1.PathHelper.quotePathSegment('test'))).to.equal('test');
|
|
158
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment('test')).to.equal('"test"');
|
|
159
|
+
(0, chai_1.expect)(JSON.parse(pathHelper_1.PathHelper.quotePathSegment('test'))).to.equal('test');
|
|
160
160
|
});
|
|
161
161
|
it('should correctly quote strings with a quotation mark', function () {
|
|
162
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegment('"')).to.equal('"\\""');
|
|
163
|
-
chai_1.expect(JSON.parse(pathHelper_1.PathHelper.quotePathSegment('"'))).to.equal('"');
|
|
162
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment('"')).to.equal('"\\""');
|
|
163
|
+
(0, chai_1.expect)(JSON.parse(pathHelper_1.PathHelper.quotePathSegment('"'))).to.equal('"');
|
|
164
164
|
});
|
|
165
165
|
it('should correctly quote strings with a backslash', function () {
|
|
166
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegment('\\')).to.equal('"\\\\"');
|
|
167
|
-
chai_1.expect(JSON.parse(pathHelper_1.PathHelper.quotePathSegment('\\'))).to.equal('\\');
|
|
166
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment('\\')).to.equal('"\\\\"');
|
|
167
|
+
(0, chai_1.expect)(JSON.parse(pathHelper_1.PathHelper.quotePathSegment('\\'))).to.equal('\\');
|
|
168
168
|
});
|
|
169
169
|
it('should work for paths with multiple occurrences of the test string', function () {
|
|
170
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegment('test"property"')).to.equal('"test\\"property\\""');
|
|
171
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegment('test\\property\\')).to.equal('"test\\\\property\\\\"');
|
|
172
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegment('test"\\property\\"')).to.equal('"test\\"\\\\property\\\\\\""');
|
|
170
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment('test"property"')).to.equal('"test\\"property\\""');
|
|
171
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment('test\\property\\')).to.equal('"test\\\\property\\\\"');
|
|
172
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegment('test"\\property\\"')).to.equal('"test\\"\\\\property\\\\\\""');
|
|
173
173
|
});
|
|
174
174
|
});
|
|
175
175
|
describe('quotePathSegmentIfNeeded', function () {
|
|
176
176
|
it('should quote all required strings', function () {
|
|
177
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('.')).to.equal('"."');
|
|
178
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('"')).to.equal('"\\""');
|
|
179
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('\\')).to.equal('"\\\\"');
|
|
180
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('[')).to.equal('"["');
|
|
181
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegmentIfNeeded(']')).to.equal('"]"');
|
|
182
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('')).to.equal('""');
|
|
183
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('/')).to.equal('"/"');
|
|
184
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('*')).to.equal('"*"');
|
|
177
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('.')).to.equal('"."');
|
|
178
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('"')).to.equal('"\\""');
|
|
179
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('\\')).to.equal('"\\\\"');
|
|
180
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('[')).to.equal('"["');
|
|
181
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded(']')).to.equal('"]"');
|
|
182
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('')).to.equal('""');
|
|
183
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('/')).to.equal('"/"');
|
|
184
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('*')).to.equal('"*"');
|
|
185
185
|
});
|
|
186
186
|
it('should not quote other strings', function () {
|
|
187
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('abcd')).to.equal('abcd');
|
|
188
|
-
chai_1.expect(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('test_string')).to.equal('test_string');
|
|
187
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('abcd')).to.equal('abcd');
|
|
188
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.quotePathSegmentIfNeeded('test_string')).to.equal('test_string');
|
|
189
189
|
});
|
|
190
190
|
});
|
|
191
191
|
describe('unquotePathSegment', function () {
|
|
192
192
|
it('should unquote simple strings', function () {
|
|
193
|
-
chai_1.expect(pathHelper_1.PathHelper.unquotePathSegment('"test"')).to.equal('test');
|
|
193
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"test"')).to.equal('test');
|
|
194
194
|
});
|
|
195
195
|
it('should correctly unquote strings with a quotation mark', function () {
|
|
196
|
-
chai_1.expect(pathHelper_1.PathHelper.unquotePathSegment('"\\""')).to.equal('"');
|
|
196
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"\\""')).to.equal('"');
|
|
197
197
|
});
|
|
198
198
|
it('should correctly unquote strings with a backslash', function () {
|
|
199
|
-
chai_1.expect(pathHelper_1.PathHelper.unquotePathSegment('"\\\\"')).to.equal('\\');
|
|
199
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"\\\\"')).to.equal('\\');
|
|
200
200
|
});
|
|
201
201
|
it('should work with empty strings', function () {
|
|
202
|
-
chai_1.expect(pathHelper_1.PathHelper.unquotePathSegment('')).to.equal('');
|
|
202
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('')).to.equal('');
|
|
203
203
|
});
|
|
204
204
|
it('should throw on non strings', function () {
|
|
205
205
|
// @ts-ignore
|
|
206
|
-
chai_1.expect(() => pathHelper_1.PathHelper.unquotePathSegment(5)).to.throw();
|
|
206
|
+
(0, chai_1.expect)(() => pathHelper_1.PathHelper.unquotePathSegment(5)).to.throw();
|
|
207
207
|
});
|
|
208
208
|
it('should work for paths with multiple occurrences of the test string', function () {
|
|
209
|
-
chai_1.expect(pathHelper_1.PathHelper.unquotePathSegment('"test\\"property\\""')).to.equal('test"property"');
|
|
210
|
-
chai_1.expect(pathHelper_1.PathHelper.unquotePathSegment('"test\\\\property\\\\"')).to.equal('test\\property\\');
|
|
211
|
-
chai_1.expect(pathHelper_1.PathHelper.unquotePathSegment('"test\\"\\\\property\\\\\\""')).to.equal('test"\\property\\"');
|
|
209
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"test\\"property\\""')).to.equal('test"property"');
|
|
210
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"test\\\\property\\\\"')).to.equal('test\\property\\');
|
|
211
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.unquotePathSegment('"test\\"\\\\property\\\\\\""')).to.equal('test"\\property\\"');
|
|
212
212
|
});
|
|
213
213
|
});
|
|
214
214
|
describe('convertAbsolutePathToCanonical', function () {
|
|
215
215
|
it('should remove leading /', function () {
|
|
216
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('/a.b.c')).to.equal('a.b.c');
|
|
216
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('/a.b.c')).to.equal('a.b.c');
|
|
217
217
|
});
|
|
218
218
|
it('should throw on ../', function () {
|
|
219
|
-
chai_1.expect(() => pathHelper_1.PathHelper.convertAbsolutePathToCanonical('../a.b.c')).to.throw('../');
|
|
219
|
+
(0, chai_1.expect)(() => pathHelper_1.PathHelper.convertAbsolutePathToCanonical('../a.b.c')).to.throw('../');
|
|
220
220
|
});
|
|
221
221
|
it('should throw on *', function () {
|
|
222
|
-
chai_1.expect(() => pathHelper_1.PathHelper.convertAbsolutePathToCanonical('/a.b.c*')).to.throw('*');
|
|
222
|
+
(0, chai_1.expect)(() => pathHelper_1.PathHelper.convertAbsolutePathToCanonical('/a.b.c*')).to.throw('*');
|
|
223
223
|
});
|
|
224
224
|
it('should replace square brackets by periods', function () {
|
|
225
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('/a.b[c]')).to.equal('a.b.c');
|
|
226
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('/a[b].c')).to.equal('a.b.c');
|
|
225
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('/a.b[c]')).to.equal('a.b.c');
|
|
226
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('/a[b].c')).to.equal('a.b.c');
|
|
227
227
|
});
|
|
228
228
|
it('should keep properly escaped property names', function () {
|
|
229
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"."')).to.equal('"."');
|
|
230
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"\\""')).to.equal('"\\""');
|
|
231
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"\\\\"')).to.equal('"\\\\"');
|
|
232
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"["')).to.equal('"["');
|
|
233
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"]"')).to.equal('"]"');
|
|
234
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('""')).to.equal('""');
|
|
235
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"/"')).to.equal('"/"');
|
|
236
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"*"')).to.equal('"*"');
|
|
229
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"."')).to.equal('"."');
|
|
230
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"\\""')).to.equal('"\\""');
|
|
231
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"\\\\"')).to.equal('"\\\\"');
|
|
232
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"["')).to.equal('"["');
|
|
233
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"]"')).to.equal('"]"');
|
|
234
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('""')).to.equal('""');
|
|
235
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"/"')).to.equal('"/"');
|
|
236
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"*"')).to.equal('"*"');
|
|
237
237
|
});
|
|
238
238
|
it('should properly unescape unusually escaped property names', function () {
|
|
239
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"a"."b"')).to.equal('a.b');
|
|
240
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"a"[b]["c"]')).to.equal('a.b.c');
|
|
239
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"a"."b"')).to.equal('a.b');
|
|
240
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('"a"[b]["c"]')).to.equal('a.b.c');
|
|
241
241
|
});
|
|
242
242
|
it('should not modify simple paths', function () {
|
|
243
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('a.b.c.d')).to.equal('a.b.c.d');
|
|
244
|
-
chai_1.expect(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('test_string')).to.equal('test_string');
|
|
243
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('a.b.c.d')).to.equal('a.b.c.d');
|
|
244
|
+
(0, chai_1.expect)(pathHelper_1.PathHelper.convertAbsolutePathToCanonical('test_string')).to.equal('test_string');
|
|
245
245
|
});
|
|
246
246
|
});
|
|
247
247
|
describe('getPathCoverage', function () {
|
|
@@ -250,56 +250,56 @@ describe('PathHelper', function () {
|
|
|
250
250
|
it('should succeed if property is included in a path 1', function () {
|
|
251
251
|
paths = ['a.b'];
|
|
252
252
|
const res = pathHelper_1.PathHelper.getPathCoverage('a.b', paths);
|
|
253
|
-
chai_1.expect(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.FULLY_COVERED);
|
|
254
|
-
chai_1.expect(res.pathList).to.deep.equal(['a.b']);
|
|
253
|
+
(0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.FULLY_COVERED);
|
|
254
|
+
(0, chai_1.expect)(res.pathList).to.deep.equal(['a.b']);
|
|
255
255
|
});
|
|
256
256
|
it('should succeed if property is included in a path 2', function () {
|
|
257
257
|
paths = ['a.b'];
|
|
258
258
|
const res = pathHelper_1.PathHelper.getPathCoverage('a.b.c', paths);
|
|
259
|
-
chai_1.expect(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.FULLY_COVERED);
|
|
260
|
-
chai_1.expect(res.pathList).to.deep.equal(['a.b']);
|
|
259
|
+
(0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.FULLY_COVERED);
|
|
260
|
+
(0, chai_1.expect)(res.pathList).to.deep.equal(['a.b']);
|
|
261
261
|
});
|
|
262
262
|
it('should succeed if property is included in a path 3', function () {
|
|
263
263
|
paths = ['a.b'];
|
|
264
264
|
const res = pathHelper_1.PathHelper.getPathCoverage('a.b.c.d', paths);
|
|
265
|
-
chai_1.expect(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.FULLY_COVERED);
|
|
266
|
-
chai_1.expect(res.pathList).to.deep.equal(['a.b']);
|
|
265
|
+
(0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.FULLY_COVERED);
|
|
266
|
+
(0, chai_1.expect)(res.pathList).to.deep.equal(['a.b']);
|
|
267
267
|
});
|
|
268
268
|
it('should fail if property is not included in any path 1', function () {
|
|
269
269
|
paths = ['a.b'];
|
|
270
270
|
const res = pathHelper_1.PathHelper.getPathCoverage('b', paths);
|
|
271
|
-
chai_1.expect(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.UNCOVERED);
|
|
272
|
-
chai_1.expect(res.pathList).to.deep.equal([]);
|
|
271
|
+
(0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.UNCOVERED);
|
|
272
|
+
(0, chai_1.expect)(res.pathList).to.deep.equal([]);
|
|
273
273
|
});
|
|
274
274
|
it('should fail if property is not included in any path 2', function () {
|
|
275
275
|
paths = ['a.b'];
|
|
276
276
|
const res = pathHelper_1.PathHelper.getPathCoverage('b.f.g', paths);
|
|
277
|
-
chai_1.expect(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.UNCOVERED);
|
|
278
|
-
chai_1.expect(res.pathList).to.deep.equal([]);
|
|
277
|
+
(0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.UNCOVERED);
|
|
278
|
+
(0, chai_1.expect)(res.pathList).to.deep.equal([]);
|
|
279
279
|
});
|
|
280
280
|
it('should fail if property is not included in any path but have common root 1', function () {
|
|
281
281
|
paths = ['a.b'];
|
|
282
282
|
const res = pathHelper_1.PathHelper.getPathCoverage('a.h', paths);
|
|
283
|
-
chai_1.expect(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.UNCOVERED);
|
|
284
|
-
chai_1.expect(res.pathList).to.deep.equal([]);
|
|
283
|
+
(0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.UNCOVERED);
|
|
284
|
+
(0, chai_1.expect)(res.pathList).to.deep.equal([]);
|
|
285
285
|
});
|
|
286
286
|
it('should fail if property is not included in any path but have common root 2', function () {
|
|
287
287
|
paths = ['a.b'];
|
|
288
288
|
const res = pathHelper_1.PathHelper.getPathCoverage('a.i.j', paths);
|
|
289
|
-
chai_1.expect(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.UNCOVERED);
|
|
290
|
-
chai_1.expect(res.pathList).to.deep.equal([]);
|
|
289
|
+
(0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.UNCOVERED);
|
|
290
|
+
(0, chai_1.expect)(res.pathList).to.deep.equal([]);
|
|
291
291
|
});
|
|
292
292
|
it('should succeed if path goes through the property 1', function () {
|
|
293
293
|
paths = ['a.b.c', 'a.b.d', 'z'];
|
|
294
294
|
const res = pathHelper_1.PathHelper.getPathCoverage('a.b', paths);
|
|
295
|
-
chai_1.expect(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.PARTLY_COVERED);
|
|
296
|
-
chai_1.expect(res.pathList).to.deep.equal(['a.b.c', 'a.b.d']);
|
|
295
|
+
(0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.PARTLY_COVERED);
|
|
296
|
+
(0, chai_1.expect)(res.pathList).to.deep.equal(['a.b.c', 'a.b.d']);
|
|
297
297
|
});
|
|
298
298
|
it('should succeed if path goes through the property 2', function () {
|
|
299
299
|
paths = ['z', 'a.b.c', 'a.b.d'];
|
|
300
300
|
const res = pathHelper_1.PathHelper.getPathCoverage('a.b', paths);
|
|
301
|
-
chai_1.expect(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.PARTLY_COVERED);
|
|
302
|
-
chai_1.expect(res.pathList).to.deep.equal(['a.b.c', 'a.b.d']);
|
|
301
|
+
(0, chai_1.expect)(res.coverageExtent).to.equal(pathHelper_1.PathHelper.CoverageExtent.PARTLY_COVERED);
|
|
302
|
+
(0, chai_1.expect)(res.pathList).to.deep.equal(['a.b.c', 'a.b.d']);
|
|
303
303
|
});
|
|
304
304
|
});
|
|
305
305
|
});
|