Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce vitest to core/ecschema-metadata #7298

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rschili
Copy link
Contributor

@rschili rschili commented Oct 28, 2024

Continuation of this effort: #7165

All remaining build errors are related to sinon or chai-as-promised, both of which need to be replaced by the respective vitest calls.

Current status:

Found 225 errors in 22 files.
Errors  Files

  •     4  src/test/Context/SchemaCache.test.ts:29 (Fixed - Nam)
  •     1  src/test/Context/SchemaContext.test.ts:43 (Fixed - Nam)
  •     1  src/test/Deserialization/XmlParser.test.ts:2805 (Fixed - Nam)
  •     3  src/test/Metadata/Class.test.ts:580 (Fixed - Nam)
  •     5  src/test/Metadata/Constant.test.ts:140
  •     1  src/test/Metadata/CustomAttributeClass.test.ts:70
  •    12  src/test/Metadata/DelayedPromise.test.ts:11
  •    34  src/test/Metadata/Deserialization.test.ts:84
  •    19  src/test/Metadata/EntityClass.test.ts:331
  •     4  src/test/Metadata/Enumeration.test.ts:227
  •    22  src/test/Metadata/Format.test.ts:270
  •     1  src/test/Metadata/InvertedUnit.test.ts:141
  •     3  src/test/Metadata/KindOfQuantity.test.ts:114
  •     6  src/test/Metadata/Mixin.test.ts:162
  •     5  src/test/Metadata/Property.test.ts:164
  •    19  src/test/Metadata/Relationship.test.ts:309
  •     1  src/test/Metadata/RelationshipConstraint.test.ts:64
  •     6  src/test/Metadata/Schema.test.ts:679
  •     3  src/test/Metadata/SchemaFromJson.test.ts:94
  •     9  src/test/Metadata/Unit.test.ts:145 (Fixed - Rob)
  •    46  src/test/SchemaPartVisitorDelegate.test.ts:37
  •    20  src/test/Validation/SchemaWalker.test.ts:137 (Fixed - Rob)

@@ -26,16 +26,20 @@ describe("Schema Cache", () => {
await cache.addSchema(schema1);

const schema2 = new Schema(context, new SchemaKey("TestSchema"), "ts");
await expect(cache.addSchema(schema2)).to.be.rejectedWith(ECObjectsError, "The schema, TestSchema.00.00.00, already exists within this cache.");
await expect(cache.addSchema(schema2)).rejects.toThrow(ECObjectsError);
await expect(cache.addSchema(schema2)).rejects.toThrow("The schema, TestSchema.00.00.00, already exists within this cache.");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hl662 is this the way to do it? This will call addSchema twice just to verify the message of the Error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants