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

fix: jest retries #37

Merged
merged 5 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ module.exports = {
testEnvironment: "node",
watchPlugins: ["jest-watch-typeahead/filename", "jest-watch-typeahead/testname"],
testTimeout: 30000,
moduleNameMapper: {
axios: "axios/dist/node/axios.cjs", // Temporary workaround: Force Jest to import the CommonJS Axios build
},
setupFilesAfterEnv: ["<rootDir>/setup-jest.js"],
};
16,289 changes: 5,761 additions & 10,528 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-prettier": "^3.4.0",
"git-cz": "^4.9.0",
"jest": "^26.6.3",
"jest-watch-typeahead": "^0.6.3",
"jest": "^29.7.0",
"jest-watch-typeahead": "^2.2.2",
"msw": "^0.28.2",
"prettier": "^2.2.1",
"semantic-release": "^19.0.2",
"snyk": "^1.931.0",
"ts-jest": "^26.5.5",
"ts-jest": "^29.2.5",
"typescript": "^4.9.5"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions setup-jest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jest.retryTimes(10);
48 changes: 24 additions & 24 deletions src/common/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe("getFragmentByName", () => {
});
it("should return OpenAttestationHash fragment", () => {
expect(getOpenAttestationHashFragment(fragments)).toMatchInlineSnapshot(`
Object {
{
"data": true,
"name": "OpenAttestationHash",
"status": "VALID",
Expand All @@ -126,9 +126,9 @@ describe("getFragmentByName", () => {
});
it("should return OpenAttestationDnsTxtIdentityProof fragment", () => {
expect(getOpenAttestationDnsTxtIdentityProofFragment(fragments)).toMatchInlineSnapshot(`
Object {
"data": Array [
Object {
{
"data": [
{
"location": "example.openattestation.com",
"status": "VALID",
"value": "0x532C9Ff853CA54370D7492cD84040F9f8099f11B",
Expand All @@ -142,9 +142,9 @@ describe("getFragmentByName", () => {
});
it("should return OpenAttestationDnsDidIdentityProof fragment", () => {
expect(getOpenAttestationDnsDidIdentityProofFragment(fragments)).toMatchInlineSnapshot(`
Object {
{
"name": "OpenAttestationDnsDidIdentityProof",
"reason": Object {
"reason": {
"code": 0,
"codeString": "SKIPPED",
"message": "Document was not issued using DNS-DID",
Expand All @@ -156,13 +156,13 @@ describe("getFragmentByName", () => {
});
it("should return OpenAttestationDidIdentityProof fragment", () => {
expect(getOpenAttestationDidIdentityProofFragment(fragments)).toMatchInlineSnapshot(`
Object {
"data": Object {
{
"data": {
"did": "did:ethr:sepolia:0x0cE1854a3836daF9130028Cf90D6d35B1Ae46457",
"verified": true,
},
"name": "OpenAttestationDidIdentityProof",
"reason": Object {
"reason": {
"code": 0,
"codeString": "OOPS",
"message": "Document was oopsed",
Expand All @@ -174,9 +174,9 @@ describe("getFragmentByName", () => {
});
it("should return OpenAttestationDidSignedDocumentStatus fragment", () => {
expect(getOpenAttestationDidSignedDocumentStatusFragment(fragments)).toMatchInlineSnapshot(`
Object {
{
"name": "OpenAttestationDidSignedDocumentStatus",
"reason": Object {
"reason": {
"code": 0,
"codeString": "SKIPPED",
"message": "Document was not signed by DID directly",
Expand All @@ -188,17 +188,17 @@ describe("getFragmentByName", () => {
});
it("should return OpenAttestationEthereumDocumentStoreStatus fragment", () => {
expect(getOpenAttestationEthereumDocumentStoreStatusFragment(fragments)).toMatchInlineSnapshot(`
Object {
"data": Object {
"details": Object {
"issuance": Array [
Object {
{
"data": {
"details": {
"issuance": [
{
"address": "0x532C9Ff853CA54370D7492cD84040F9f8099f11B",
"issued": true,
},
],
"revocation": Array [
Object {
"revocation": [
{
"address": "0x532C9Ff853CA54370D7492cD84040F9f8099f11B",
"revoked": false,
},
Expand All @@ -215,12 +215,12 @@ describe("getFragmentByName", () => {
});
it("should return OpenAttestationEthereumTokenRegistryStatus fragment", () => {
expect(getOpenAttestationEthereumTokenRegistryStatusFragment(fragments)).toMatchInlineSnapshot(`
Object {
{
"name": "OpenAttestationEthereumTokenRegistryStatus",
"reason": Object {
"reason": {
"code": 4,
"codeString": "SKIPPED",
"message": "Document issuers doesn't have \\"tokenRegistry\\" property or TOKEN_REGISTRY method",
"message": "Document issuers doesn't have "tokenRegistry" property or TOKEN_REGISTRY method",
},
"status": "SKIPPED",
"type": "DOCUMENT_STATUS",
Expand All @@ -233,15 +233,15 @@ describe("getFragmentsByType", () => {
it("should return DOCUMENT_INTEGRITY fragments", () => {
const documentIntegrityFragments = getDocumentIntegrityFragments(fragments);
expect(documentIntegrityFragments.map((fragment) => fragment.name)).toMatchInlineSnapshot(`
Array [
[
"OpenAttestationHash",
]
`);
});
it("should return DOCUMENT_STATUS fragments", () => {
const documentStatusFragments = getDocumentStatusFragments(fragments);
expect(documentStatusFragments.map((fragment) => fragment.name)).toMatchInlineSnapshot(`
Array [
[
"OpenAttestationEthereumTokenRegistryStatus",
"OpenAttestationEthereumDocumentStoreStatus",
"OpenAttestationDidSignedDocumentStatus",
Expand All @@ -251,7 +251,7 @@ describe("getFragmentsByType", () => {
it("should return ISSUER_IDENTITY fragments", () => {
const issuerIdentityFragments = getIssuerIdentityFragments(fragments);
expect(issuerIdentityFragments.map((fragment) => fragment.name)).toMatchInlineSnapshot(`
Array [
[
"OpenAttestationDnsTxtIdentityProof",
"OpenAttestationDnsDidIdentityProof",
"OpenAttestationDidIdentityProof",
Expand Down
4 changes: 2 additions & 2 deletions src/did/resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ describe("custom resolver", () => {
const fragment = await verify(v3DidSigned);
expect(fragment[0].status).toBe("VALID");
expect(fragment[0]).toMatchInlineSnapshot(`
Object {
"data": Object {
{
"data": {
"did": "did:ethr:0x7020be74e640afa14430f2c807f511b1559c5f60",
"verified": true,
},
Expand Down
Loading
Loading