@fluid-experimental/property-changeset 0.59.2001 → 0.59.3000-66610
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,75 +15,75 @@ const schemaValidator_1 = require("../schemaValidator");
|
|
|
15
15
|
it("should validate a simple file", function () {
|
|
16
16
|
const testFile1 = require("../schemas/goodPointId");
|
|
17
17
|
const result = schemaValidator.validate(testFile1);
|
|
18
|
-
chai_1.expect(result.errors.length).to.equal(0);
|
|
19
|
-
chai_1.expect(result.unresolvedTypes.length).to.be.greaterThan(0);
|
|
18
|
+
(0, chai_1.expect)(result.errors.length).to.equal(0);
|
|
19
|
+
(0, chai_1.expect)(result.unresolvedTypes.length).to.be.greaterThan(0);
|
|
20
20
|
});
|
|
21
21
|
it("should fail a file with a bad versioned typeid in it", function () {
|
|
22
22
|
const testFile2 = require("../schemas/badVersionedTypeid");
|
|
23
23
|
const result = schemaValidator.validate(testFile2);
|
|
24
|
-
chai_1.expect(result.isValid).to.equal(false);
|
|
25
|
-
chai_1.expect(result.errors.length).to.equal(1);
|
|
24
|
+
(0, chai_1.expect)(result.isValid).to.equal(false);
|
|
25
|
+
(0, chai_1.expect)(result.errors.length).to.equal(1);
|
|
26
26
|
});
|
|
27
27
|
it("should fail a file with a bad primitive typeid in it", function () {
|
|
28
28
|
const testFile2 = require("../schemas/badPrimitiveTypeid");
|
|
29
29
|
const result = schemaValidator.validate(testFile2);
|
|
30
|
-
chai_1.expect(result.isValid).to.equal(false);
|
|
31
|
-
chai_1.expect(result.errors.length).to.be.greaterThan(0);
|
|
30
|
+
(0, chai_1.expect)(result.isValid).to.equal(false);
|
|
31
|
+
(0, chai_1.expect)(result.errors.length).to.be.greaterThan(0);
|
|
32
32
|
});
|
|
33
33
|
it("should fail when both properties and typeid/id are specified", function () {
|
|
34
34
|
const testFile3 = require("../schemas/badBothPropertiesAndTypeid");
|
|
35
35
|
const result = schemaValidator.validate(testFile3);
|
|
36
|
-
chai_1.expect(result.isValid).to.equal(false);
|
|
37
|
-
chai_1.expect(result.errors.length).to.be.greaterThan(0);
|
|
36
|
+
(0, chai_1.expect)(result.isValid).to.equal(false);
|
|
37
|
+
(0, chai_1.expect)(result.errors.length).to.be.greaterThan(0);
|
|
38
38
|
});
|
|
39
39
|
it("Should permit declaration of enums inline", function () {
|
|
40
40
|
const testFile4 = require("../schemas/goodUIBorder");
|
|
41
41
|
const result = schemaValidator.validate(testFile4);
|
|
42
|
-
chai_1.expect(result.isValid).to.equal(true);
|
|
43
|
-
chai_1.expect(result.errors.length).to.equal(0);
|
|
44
|
-
chai_1.expect(result.unresolvedTypes.length).to.equal(0); // Only simple types
|
|
42
|
+
(0, chai_1.expect)(result.isValid).to.equal(true);
|
|
43
|
+
(0, chai_1.expect)(result.errors.length).to.equal(0);
|
|
44
|
+
(0, chai_1.expect)(result.unresolvedTypes.length).to.equal(0); // Only simple types
|
|
45
45
|
});
|
|
46
46
|
it("Should support both kinds of reference types", function () {
|
|
47
47
|
const testFile5 = require("../schemas/goodColorPalette");
|
|
48
48
|
const result = schemaValidator.validate(testFile5);
|
|
49
|
-
chai_1.expect(result.isValid).to.equal(true);
|
|
50
|
-
chai_1.expect(result.errors.length).to.equal(0);
|
|
51
|
-
chai_1.expect(result.unresolvedTypes.length).to.be.greaterThan(0);
|
|
49
|
+
(0, chai_1.expect)(result.isValid).to.equal(true);
|
|
50
|
+
(0, chai_1.expect)(result.errors.length).to.equal(0);
|
|
51
|
+
(0, chai_1.expect)(result.unresolvedTypes.length).to.be.greaterThan(0);
|
|
52
52
|
});
|
|
53
53
|
it("Should find errors down in nested types", function () {
|
|
54
54
|
const testFile6 = require("../schemas/badNestedProperties");
|
|
55
55
|
const result = schemaValidator.validate(testFile6);
|
|
56
|
-
chai_1.expect(result.isValid).to.equal(false);
|
|
57
|
-
chai_1.expect(result.errors.length).to.be.greaterThan(0);
|
|
58
|
-
chai_1.expect(result.unresolvedTypes.length).to.equal(2);
|
|
56
|
+
(0, chai_1.expect)(result.isValid).to.equal(false);
|
|
57
|
+
(0, chai_1.expect)(result.errors.length).to.be.greaterThan(0);
|
|
58
|
+
(0, chai_1.expect)(result.unresolvedTypes.length).to.equal(2);
|
|
59
59
|
});
|
|
60
60
|
it("Should extract typeids from references", function () {
|
|
61
61
|
const testFile7 = require("../schemas/goodReferenceAndRegular");
|
|
62
62
|
const result = schemaValidator.validate(testFile7);
|
|
63
|
-
chai_1.expect(result.isValid).to.equal(true);
|
|
64
|
-
chai_1.expect(result.errors.length).to.equal(0);
|
|
65
|
-
chai_1.expect(result.unresolvedTypes.length).to.equal(1);
|
|
63
|
+
(0, chai_1.expect)(result.isValid).to.equal(true);
|
|
64
|
+
(0, chai_1.expect)(result.errors.length).to.equal(0);
|
|
65
|
+
(0, chai_1.expect)(result.unresolvedTypes.length).to.equal(1);
|
|
66
66
|
});
|
|
67
67
|
it("should validate a typeid with reserved type Ids", function () {
|
|
68
68
|
const testFile8 = require("../schemas/goodReservedTypes");
|
|
69
69
|
const result = schemaValidator.validate(testFile8);
|
|
70
|
-
chai_1.expect(result.isValid).to.equal(true);
|
|
71
|
-
chai_1.expect(result.errors.length).to.equal(0);
|
|
72
|
-
chai_1.expect(result.unresolvedTypes.length).to.be.greaterThan(0);
|
|
70
|
+
(0, chai_1.expect)(result.isValid).to.equal(true);
|
|
71
|
+
(0, chai_1.expect)(result.errors.length).to.equal(0);
|
|
72
|
+
(0, chai_1.expect)(result.unresolvedTypes.length).to.be.greaterThan(0);
|
|
73
73
|
});
|
|
74
74
|
it("should validate a typeid with draft as version", function () {
|
|
75
75
|
const testFile9 = require("../schemas/goodDraftAsVersion");
|
|
76
76
|
const result = schemaValidator.validate(testFile9, testFile9, false, true, true);
|
|
77
|
-
chai_1.expect(result.isValid).to.equal(true);
|
|
78
|
-
chai_1.expect(result.errors.length).to.equal(0);
|
|
79
|
-
chai_1.expect(result.unresolvedTypes.length).to.be.equal(0);
|
|
77
|
+
(0, chai_1.expect)(result.isValid).to.equal(true);
|
|
78
|
+
(0, chai_1.expect)(result.errors.length).to.equal(0);
|
|
79
|
+
(0, chai_1.expect)(result.unresolvedTypes.length).to.be.equal(0);
|
|
80
80
|
});
|
|
81
81
|
it("should validate a typeid with draft as version", function () {
|
|
82
82
|
const testFile9 = require("../schemas/goodDraftAsVersion");
|
|
83
83
|
const result = schemaValidator.validate(testFile9, testFile9, false, true, false);
|
|
84
|
-
chai_1.expect(result.isValid).to.equal(false);
|
|
85
|
-
chai_1.expect(result.errors.length).to.equal(1);
|
|
86
|
-
chai_1.expect(result.unresolvedTypes.length).to.be.equal(0);
|
|
84
|
+
(0, chai_1.expect)(result.isValid).to.equal(false);
|
|
85
|
+
(0, chai_1.expect)(result.errors.length).to.equal(1);
|
|
86
|
+
(0, chai_1.expect)(result.unresolvedTypes.length).to.be.equal(0);
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateSyntax.spec.js","sourceRoot":"","sources":["../../../src/test/validator/templateSyntax.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH;;GAEG;;AAEH,+BAA8B;AAC9B,wDAAqD;AAErD,CAAC;IACG,QAAQ,CAAC,4BAA4B,EAAE;QACnC,MAAM,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;QAE9C,EAAE,CAAC,+BAA+B,EAAE;YAChC,MAAM,SAAS,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;YAEpD,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,CA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AC,CAAC,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gDAAgD,EAAE;YACjD,MAAM,SAAS,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;YAC3D,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;YAElF,IAAA,aAAM,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACvC,IAAA,aAAM,EAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACzC,IAAA,aAAM,EAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview In this file, we will test template syntax.\n */\n\nimport { expect } from 'chai';\nimport { SchemaValidator } from \"../schemaValidator\";\n\n(function() {\n describe(\"Simple Template Validation\", function() {\n const schemaValidator = new SchemaValidator();\n\n it(\"should validate a simple file\", function() {\n const testFile1 = require(\"../schemas/goodPointId\");\n\n const result = schemaValidator.validate(testFile1);\n\n expect(result.errors.length).to.equal(0);\n expect(result.unresolvedTypes.length).to.be.greaterThan(0);\n });\n\n it(\"should fail a file with a bad versioned typeid in it\", function() {\n const testFile2 = require(\"../schemas/badVersionedTypeid\");\n const result = schemaValidator.validate(testFile2);\n\n expect(result.isValid).to.equal(false);\n expect(result.errors.length).to.equal(1);\n });\n\n it(\"should fail a file with a bad primitive typeid in it\", function() {\n const testFile2 = require(\"../schemas/badPrimitiveTypeid\");\n const result = schemaValidator.validate(testFile2);\n\n expect(result.isValid).to.equal(false);\n expect(result.errors.length).to.be.greaterThan(0);\n });\n\n it(\"should fail when both properties and typeid/id are specified\", function() {\n const testFile3 = require(\"../schemas/badBothPropertiesAndTypeid\");\n const result = schemaValidator.validate(testFile3);\n\n expect(result.isValid).to.equal(false);\n expect(result.errors.length).to.be.greaterThan(0);\n });\n\n it(\"Should permit declaration of enums inline\", function() {\n const testFile4 = require(\"../schemas/goodUIBorder\");\n const result = schemaValidator.validate(testFile4);\n\n expect(result.isValid).to.equal(true);\n expect(result.errors.length).to.equal(0);\n expect(result.unresolvedTypes.length).to.equal(0); // Only simple types\n });\n\n it(\"Should support both kinds of reference types\", function() {\n const testFile5 = require(\"../schemas/goodColorPalette\");\n const result = schemaValidator.validate(testFile5);\n\n expect(result.isValid).to.equal(true);\n expect(result.errors.length).to.equal(0);\n expect(result.unresolvedTypes.length).to.be.greaterThan(0);\n });\n\n it(\"Should find errors down in nested types\", function() {\n const testFile6 = require(\"../schemas/badNestedProperties\");\n const result = schemaValidator.validate(testFile6);\n\n expect(result.isValid).to.equal(false);\n expect(result.errors.length).to.be.greaterThan(0);\n expect(result.unresolvedTypes.length).to.equal(2);\n });\n\n it(\"Should extract typeids from references\", function() {\n const testFile7 = require(\"../schemas/goodReferenceAndRegular\");\n const result = schemaValidator.validate(testFile7);\n\n expect(result.isValid).to.equal(true);\n expect(result.errors.length).to.equal(0);\n expect(result.unresolvedTypes.length).to.equal(1);\n });\n\n it(\"should validate a typeid with reserved type Ids\", function() {\n const testFile8 = require(\"../schemas/goodReservedTypes\");\n const result = schemaValidator.validate(testFile8);\n\n expect(result.isValid).to.equal(true);\n expect(result.errors.length).to.equal(0);\n expect(result.unresolvedTypes.length).to.be.greaterThan(0);\n });\n\n it(\"should validate a typeid with draft as version\", function() {\n const testFile9 = require(\"../schemas/goodDraftAsVersion\");\n const result = schemaValidator.validate(testFile9, testFile9, false, true, true);\n\n expect(result.isValid).to.equal(true);\n expect(result.errors.length).to.equal(0);\n expect(result.unresolvedTypes.length).to.be.equal(0);\n });\n\n it(\"should validate a typeid with draft as version\", function() {\n const testFile9 = require(\"../schemas/goodDraftAsVersion\");\n const result = schemaValidator.validate(testFile9, testFile9, false, true, false);\n\n expect(result.isValid).to.equal(false);\n expect(result.errors.length).to.equal(1);\n expect(result.unresolvedTypes.length).to.be.equal(0);\n });\n });\n})();\n"]}
|