Skip to content

Commit

Permalink
fix: upgrade jest
Browse files Browse the repository at this point in the history
  • Loading branch information
rongquan1 committed Dec 3, 2024
1 parent 7761b61 commit 59d6917
Show file tree
Hide file tree
Showing 16 changed files with 6,826 additions and 11,596 deletions.
3 changes: 0 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +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
2 changes: 1 addition & 1 deletion setup-jest.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jest.retryTimes(10);
jest.retryTimes(3);
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

0 comments on commit 59d6917

Please sign in to comment.