mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #17362 from overleaf/bg-chai-object-id-tests
fix for chai object id tests GitOrigin-RevId: 98123dbc930c6ee57be3a118177426120482c5f4
This commit is contained in:
parent
3083d8082f
commit
9babc70df7
24 changed files with 85 additions and 499 deletions
481
package-lock.json
generated
481
package-lock.json
generated
|
@ -41974,7 +41974,6 @@
|
||||||
"celebrate": "^15.0.3",
|
"celebrate": "^15.0.3",
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mongodb": "^6.2.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"p-map": "^4.0.0",
|
"p-map": "^4.0.0",
|
||||||
"request": "^2.88.2"
|
"request": "^2.88.2"
|
||||||
|
@ -41999,73 +41998,6 @@
|
||||||
"node": ">=0.3.1"
|
"node": ">=0.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"services/docstore/node_modules/gcp-metadata": {
|
|
||||||
"version": "5.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz",
|
|
||||||
"integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==",
|
|
||||||
"optional": true,
|
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
|
||||||
"gaxios": "^5.0.0",
|
|
||||||
"json-bigint": "^1.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/docstore/node_modules/mongodb": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-d7OSuGjGWDZ5usZPqfvb36laQ9CPhnWkAGHT61x5P95p/8nMVeH8asloMwW6GcYFeB0Vj4CB/1wOTDG2RA9BFA==",
|
|
||||||
"dependencies": {
|
|
||||||
"@mongodb-js/saslprep": "^1.1.0",
|
|
||||||
"bson": "^6.2.0",
|
|
||||||
"mongodb-connection-string-url": "^2.6.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.20.1"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@aws-sdk/credential-providers": "^3.188.0",
|
|
||||||
"@mongodb-js/zstd": "^1.1.0",
|
|
||||||
"gcp-metadata": "^5.2.0",
|
|
||||||
"kerberos": "^2.0.1",
|
|
||||||
"mongodb-client-encryption": ">=6.0.0 <7",
|
|
||||||
"snappy": "^7.2.2",
|
|
||||||
"socks": "^2.7.1"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@aws-sdk/credential-providers": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"@mongodb-js/zstd": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"gcp-metadata": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"kerberos": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"mongodb-client-encryption": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"snappy": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"socks": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/docstore/node_modules/mongodb/node_modules/bson": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.20.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/docstore/node_modules/sinon": {
|
"services/docstore/node_modules/sinon": {
|
||||||
"version": "9.0.3",
|
"version": "9.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.3.tgz",
|
||||||
|
@ -42114,7 +42046,6 @@
|
||||||
"diff-match-patch": "overleaf/diff-match-patch#89805f9c671a77a263fc53461acd62aa7498f688",
|
"diff-match-patch": "overleaf/diff-match-patch#89805f9c671a77a263fc53461acd62aa7498f688",
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mongodb": "^6.2.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"requestretry": "^7.1.0"
|
"requestretry": "^7.1.0"
|
||||||
|
@ -42131,73 +42062,6 @@
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"services/document-updater/node_modules/bson": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.20.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/document-updater/node_modules/gcp-metadata": {
|
|
||||||
"version": "5.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz",
|
|
||||||
"integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==",
|
|
||||||
"optional": true,
|
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
|
||||||
"gaxios": "^5.0.0",
|
|
||||||
"json-bigint": "^1.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/document-updater/node_modules/mongodb": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-d7OSuGjGWDZ5usZPqfvb36laQ9CPhnWkAGHT61x5P95p/8nMVeH8asloMwW6GcYFeB0Vj4CB/1wOTDG2RA9BFA==",
|
|
||||||
"dependencies": {
|
|
||||||
"@mongodb-js/saslprep": "^1.1.0",
|
|
||||||
"bson": "^6.2.0",
|
|
||||||
"mongodb-connection-string-url": "^2.6.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.20.1"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@aws-sdk/credential-providers": "^3.188.0",
|
|
||||||
"@mongodb-js/zstd": "^1.1.0",
|
|
||||||
"gcp-metadata": "^5.2.0",
|
|
||||||
"kerberos": "^2.0.1",
|
|
||||||
"mongodb-client-encryption": ">=6.0.0 <7",
|
|
||||||
"snappy": "^7.2.2",
|
|
||||||
"socks": "^2.7.1"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@aws-sdk/credential-providers": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"@mongodb-js/zstd": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"gcp-metadata": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"kerberos": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"mongodb-client-encryption": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"snappy": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"socks": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/filestore": {
|
"services/filestore": {
|
||||||
"name": "@overleaf/filestore",
|
"name": "@overleaf/filestore",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -42377,7 +42241,6 @@
|
||||||
"bunyan": "^1.8.15",
|
"bunyan": "^1.8.15",
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mongodb": "^6.1.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"octonode": "^0.9.5",
|
"octonode": "^0.9.5",
|
||||||
"p-limit": "^2.2.0",
|
"p-limit": "^2.2.0",
|
||||||
|
@ -42394,73 +42257,6 @@
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"services/github-sync/node_modules/bson": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.20.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/github-sync/node_modules/gcp-metadata": {
|
|
||||||
"version": "5.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz",
|
|
||||||
"integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==",
|
|
||||||
"optional": true,
|
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
|
||||||
"gaxios": "^5.0.0",
|
|
||||||
"json-bigint": "^1.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/github-sync/node_modules/mongodb": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-AvzNY0zMkpothZ5mJAaIo2bGDjlJQqqAbn9fvtVgwIIUPEfdrqGxqNjjbuKyrgQxg2EvCmfWdjq+4uj96c0YPw==",
|
|
||||||
"dependencies": {
|
|
||||||
"@mongodb-js/saslprep": "^1.1.0",
|
|
||||||
"bson": "^6.1.0",
|
|
||||||
"mongodb-connection-string-url": "^2.6.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.20.1"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@aws-sdk/credential-providers": "^3.188.0",
|
|
||||||
"@mongodb-js/zstd": "^1.1.0",
|
|
||||||
"gcp-metadata": "^5.2.0",
|
|
||||||
"kerberos": "^2.0.1",
|
|
||||||
"mongodb-client-encryption": ">=6.0.0 <7",
|
|
||||||
"snappy": "^7.2.2",
|
|
||||||
"socks": "^2.7.1"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@aws-sdk/credential-providers": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"@mongodb-js/zstd": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"gcp-metadata": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"kerberos": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"mongodb-client-encryption": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"snappy": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"socks": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/github-sync/node_modules/p-limit": {
|
"services/github-sync/node_modules/p-limit": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
|
||||||
|
@ -43867,7 +43663,6 @@
|
||||||
"bunyan": "^1.8.15",
|
"bunyan": "^1.8.15",
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"method-override": "^3.0.0",
|
"method-override": "^3.0.0",
|
||||||
"mongodb": "^6.1.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"request": "^2.88.2"
|
"request": "^2.88.2"
|
||||||
},
|
},
|
||||||
|
@ -43880,73 +43675,6 @@
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"services/notifications/node_modules/bson": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.20.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/notifications/node_modules/gcp-metadata": {
|
|
||||||
"version": "5.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz",
|
|
||||||
"integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==",
|
|
||||||
"optional": true,
|
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
|
||||||
"gaxios": "^5.0.0",
|
|
||||||
"json-bigint": "^1.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/notifications/node_modules/mongodb": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-AvzNY0zMkpothZ5mJAaIo2bGDjlJQqqAbn9fvtVgwIIUPEfdrqGxqNjjbuKyrgQxg2EvCmfWdjq+4uj96c0YPw==",
|
|
||||||
"dependencies": {
|
|
||||||
"@mongodb-js/saslprep": "^1.1.0",
|
|
||||||
"bson": "^6.1.0",
|
|
||||||
"mongodb-connection-string-url": "^2.6.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.20.1"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@aws-sdk/credential-providers": "^3.188.0",
|
|
||||||
"@mongodb-js/zstd": "^1.1.0",
|
|
||||||
"gcp-metadata": "^5.2.0",
|
|
||||||
"kerberos": "^2.0.1",
|
|
||||||
"mongodb-client-encryption": ">=6.0.0 <7",
|
|
||||||
"snappy": "^7.2.2",
|
|
||||||
"socks": "^2.7.1"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@aws-sdk/credential-providers": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"@mongodb-js/zstd": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"gcp-metadata": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"kerberos": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"mongodb-client-encryption": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"snappy": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"socks": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/project-history": {
|
"services/project-history": {
|
||||||
"name": "@overleaf/project-history",
|
"name": "@overleaf/project-history",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -44309,7 +44037,6 @@
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"lru-cache": "^5.1.1",
|
"lru-cache": "^5.1.1",
|
||||||
"mongodb": "^6.1.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"oauth": "0.9.15",
|
"oauth": "0.9.15",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
|
@ -44326,14 +44053,6 @@
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"services/third-party-references/node_modules/bson": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.20.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/third-party-references/node_modules/diff": {
|
"services/third-party-references/node_modules/diff": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||||
|
@ -44343,65 +44062,6 @@
|
||||||
"node": ">=0.3.1"
|
"node": ">=0.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"services/third-party-references/node_modules/gcp-metadata": {
|
|
||||||
"version": "5.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz",
|
|
||||||
"integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==",
|
|
||||||
"optional": true,
|
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
|
||||||
"gaxios": "^5.0.0",
|
|
||||||
"json-bigint": "^1.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/third-party-references/node_modules/mongodb": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-AvzNY0zMkpothZ5mJAaIo2bGDjlJQqqAbn9fvtVgwIIUPEfdrqGxqNjjbuKyrgQxg2EvCmfWdjq+4uj96c0YPw==",
|
|
||||||
"dependencies": {
|
|
||||||
"@mongodb-js/saslprep": "^1.1.0",
|
|
||||||
"bson": "^6.1.0",
|
|
||||||
"mongodb-connection-string-url": "^2.6.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.20.1"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@aws-sdk/credential-providers": "^3.188.0",
|
|
||||||
"@mongodb-js/zstd": "^1.1.0",
|
|
||||||
"gcp-metadata": "^5.2.0",
|
|
||||||
"kerberos": "^2.0.1",
|
|
||||||
"mongodb-client-encryption": ">=6.0.0 <7",
|
|
||||||
"snappy": "^7.2.2",
|
|
||||||
"socks": "^2.7.1"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@aws-sdk/credential-providers": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"@mongodb-js/zstd": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"gcp-metadata": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"kerberos": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"mongodb-client-encryption": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"snappy": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"socks": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"services/third-party-references/node_modules/sinon": {
|
"services/third-party-references/node_modules/sinon": {
|
||||||
"version": "9.0.2",
|
"version": "9.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.2.tgz",
|
||||||
|
@ -52048,7 +51708,6 @@
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"mongodb": "^6.2.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"p-map": "^4.0.0",
|
"p-map": "^4.0.0",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
|
@ -52064,34 +51723,6 @@
|
||||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"gcp-metadata": {
|
|
||||||
"version": "5.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz",
|
|
||||||
"integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==",
|
|
||||||
"optional": true,
|
|
||||||
"peer": true,
|
|
||||||
"requires": {
|
|
||||||
"gaxios": "^5.0.0",
|
|
||||||
"json-bigint": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mongodb": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-d7OSuGjGWDZ5usZPqfvb36laQ9CPhnWkAGHT61x5P95p/8nMVeH8asloMwW6GcYFeB0Vj4CB/1wOTDG2RA9BFA==",
|
|
||||||
"requires": {
|
|
||||||
"@mongodb-js/saslprep": "^1.1.0",
|
|
||||||
"bson": "^6.2.0",
|
|
||||||
"mongodb-connection-string-url": "^2.6.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"bson": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sinon": {
|
"sinon": {
|
||||||
"version": "9.0.3",
|
"version": "9.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.3.tgz",
|
||||||
|
@ -52139,7 +51770,6 @@
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"mongodb": "^6.2.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"requestretry": "^7.1.0",
|
"requestretry": "^7.1.0",
|
||||||
|
@ -52148,34 +51778,6 @@
|
||||||
"sinon-chai": "^3.7.0",
|
"sinon-chai": "^3.7.0",
|
||||||
"timekeeper": "^2.0.0",
|
"timekeeper": "^2.0.0",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"bson": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q=="
|
|
||||||
},
|
|
||||||
"gcp-metadata": {
|
|
||||||
"version": "5.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz",
|
|
||||||
"integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==",
|
|
||||||
"optional": true,
|
|
||||||
"peer": true,
|
|
||||||
"requires": {
|
|
||||||
"gaxios": "^5.0.0",
|
|
||||||
"json-bigint": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mongodb": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-d7OSuGjGWDZ5usZPqfvb36laQ9CPhnWkAGHT61x5P95p/8nMVeH8asloMwW6GcYFeB0Vj4CB/1wOTDG2RA9BFA==",
|
|
||||||
"requires": {
|
|
||||||
"@mongodb-js/saslprep": "^1.1.0",
|
|
||||||
"bson": "^6.2.0",
|
|
||||||
"mongodb-connection-string-url": "^2.6.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@overleaf/eslint-plugin": {
|
"@overleaf/eslint-plugin": {
|
||||||
|
@ -52342,7 +51944,6 @@
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"mongodb": "^6.1.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"octonode": "^0.9.5",
|
"octonode": "^0.9.5",
|
||||||
"p-limit": "^2.2.0",
|
"p-limit": "^2.2.0",
|
||||||
|
@ -52354,32 +51955,6 @@
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bson": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q=="
|
|
||||||
},
|
|
||||||
"gcp-metadata": {
|
|
||||||
"version": "5.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz",
|
|
||||||
"integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==",
|
|
||||||
"optional": true,
|
|
||||||
"peer": true,
|
|
||||||
"requires": {
|
|
||||||
"gaxios": "^5.0.0",
|
|
||||||
"json-bigint": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mongodb": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-AvzNY0zMkpothZ5mJAaIo2bGDjlJQqqAbn9fvtVgwIIUPEfdrqGxqNjjbuKyrgQxg2EvCmfWdjq+4uj96c0YPw==",
|
|
||||||
"requires": {
|
|
||||||
"@mongodb-js/saslprep": "^1.1.0",
|
|
||||||
"bson": "^6.1.0",
|
|
||||||
"mongodb-connection-string-url": "^2.6.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"p-limit": {
|
"p-limit": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
|
||||||
|
@ -52461,40 +52036,11 @@
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"method-override": "^3.0.0",
|
"method-override": "^3.0.0",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"mongodb": "^6.1.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"sandboxed-module": "^2.0.4",
|
"sandboxed-module": "^2.0.4",
|
||||||
"sinon": "^9.2.4",
|
"sinon": "^9.2.4",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"bson": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q=="
|
|
||||||
},
|
|
||||||
"gcp-metadata": {
|
|
||||||
"version": "5.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz",
|
|
||||||
"integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==",
|
|
||||||
"optional": true,
|
|
||||||
"peer": true,
|
|
||||||
"requires": {
|
|
||||||
"gaxios": "^5.0.0",
|
|
||||||
"json-bigint": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mongodb": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-AvzNY0zMkpothZ5mJAaIo2bGDjlJQqqAbn9fvtVgwIIUPEfdrqGxqNjjbuKyrgQxg2EvCmfWdjq+4uj96c0YPw==",
|
|
||||||
"requires": {
|
|
||||||
"@mongodb-js/saslprep": "^1.1.0",
|
|
||||||
"bson": "^6.1.0",
|
|
||||||
"mongodb-connection-string-url": "^2.6.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@overleaf/o-error": {
|
"@overleaf/o-error": {
|
||||||
|
@ -52975,7 +52521,6 @@
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"lru-cache": "^5.1.1",
|
"lru-cache": "^5.1.1",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"mongodb": "^6.1.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"oauth": "0.9.15",
|
"oauth": "0.9.15",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
|
@ -52985,38 +52530,12 @@
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bson": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q=="
|
|
||||||
},
|
|
||||||
"diff": {
|
"diff": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"gcp-metadata": {
|
|
||||||
"version": "5.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz",
|
|
||||||
"integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==",
|
|
||||||
"optional": true,
|
|
||||||
"peer": true,
|
|
||||||
"requires": {
|
|
||||||
"gaxios": "^5.0.0",
|
|
||||||
"json-bigint": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mongodb": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-AvzNY0zMkpothZ5mJAaIo2bGDjlJQqqAbn9fvtVgwIIUPEfdrqGxqNjjbuKyrgQxg2EvCmfWdjq+4uj96c0YPw==",
|
|
||||||
"requires": {
|
|
||||||
"@mongodb-js/saslprep": "^1.1.0",
|
|
||||||
"bson": "^6.1.0",
|
|
||||||
"mongodb-connection-string-url": "^2.6.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sinon": {
|
"sinon": {
|
||||||
"version": "9.0.2",
|
"version": "9.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.2.tgz",
|
||||||
|
|
3
services/chat/.mocharc.json
Normal file
3
services/chat/.mocharc.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"require": "test/setup.js"
|
||||||
|
}
|
9
services/chat/test/setup.js
Normal file
9
services/chat/test/setup.js
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import chai from 'chai'
|
||||||
|
import chaiAsPromised from 'chai-as-promised'
|
||||||
|
import { ObjectId } from 'mongodb'
|
||||||
|
|
||||||
|
// ensure every ObjectId has the id string as a property for correct comparisons
|
||||||
|
ObjectId.cacheHexString = true
|
||||||
|
|
||||||
|
chai.should()
|
||||||
|
chai.use(chaiAsPromised)
|
|
@ -1,6 +1,10 @@
|
||||||
import chai from 'chai'
|
import chai from 'chai'
|
||||||
import chaiAsPromised from 'chai-as-promised'
|
import chaiAsPromised from 'chai-as-promised'
|
||||||
import sinonChai from 'sinon-chai'
|
import sinonChai from 'sinon-chai'
|
||||||
|
import { ObjectId } from 'mongodb'
|
||||||
|
|
||||||
|
// ensure every ObjectId has the id string as a property for correct comparisons
|
||||||
|
ObjectId.cacheHexString = true
|
||||||
|
|
||||||
chai.should()
|
chai.should()
|
||||||
chai.use(chaiAsPromised)
|
chai.use(chaiAsPromised)
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
"celebrate": "^15.0.3",
|
"celebrate": "^15.0.3",
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mongodb": "^6.2.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"p-map": "^4.0.0",
|
"p-map": "^4.0.0",
|
||||||
"request": "^2.88.2"
|
"request": "^2.88.2"
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||||
*/
|
*/
|
||||||
const sinon = require('sinon')
|
const sinon = require('sinon')
|
||||||
const { ObjectId } = require('mongodb')
|
const { ObjectId } = require('mongodb-legacy')
|
||||||
const async = require('async')
|
const async = require('async')
|
||||||
const DocstoreApp = require('./helpers/DocstoreApp')
|
const DocstoreApp = require('./helpers/DocstoreApp')
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||||
*/
|
*/
|
||||||
const sinon = require('sinon')
|
const sinon = require('sinon')
|
||||||
const { ObjectId } = require('mongodb')
|
const { ObjectId } = require('mongodb-legacy')
|
||||||
const DocstoreApp = require('./helpers/DocstoreApp')
|
const DocstoreApp = require('./helpers/DocstoreApp')
|
||||||
|
|
||||||
const DocstoreClient = require('./helpers/DocstoreClient')
|
const DocstoreClient = require('./helpers/DocstoreClient')
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||||
*/
|
*/
|
||||||
const sinon = require('sinon')
|
const sinon = require('sinon')
|
||||||
const { ObjectId } = require('mongodb')
|
const { ObjectId } = require('mongodb-legacy')
|
||||||
const DocstoreApp = require('./helpers/DocstoreApp')
|
const DocstoreApp = require('./helpers/DocstoreApp')
|
||||||
|
|
||||||
const DocstoreClient = require('./helpers/DocstoreClient')
|
const DocstoreClient = require('./helpers/DocstoreClient')
|
||||||
|
|
|
@ -5,6 +5,9 @@ const chaiAsPromised = require('chai-as-promised')
|
||||||
const SandboxedModule = require('sandboxed-module')
|
const SandboxedModule = require('sandboxed-module')
|
||||||
const timersPromises = require('timers/promises')
|
const timersPromises = require('timers/promises')
|
||||||
|
|
||||||
|
// ensure every ObjectId has the id string as a property for correct comparisons
|
||||||
|
require('mongodb-legacy').ObjectId.cacheHexString = true
|
||||||
|
|
||||||
process.env.BACKEND = 'gcs'
|
process.env.BACKEND = 'gcs'
|
||||||
|
|
||||||
// Chai configuration
|
// Chai configuration
|
||||||
|
@ -31,6 +34,8 @@ SandboxedModule.configure({
|
||||||
requires: {
|
requires: {
|
||||||
'@overleaf/logger': stubs.logger,
|
'@overleaf/logger': stubs.logger,
|
||||||
'timers/promises': timersPromises,
|
'timers/promises': timersPromises,
|
||||||
|
'mongodb-legacy': require('mongodb-legacy'),
|
||||||
|
bson: require('bson'),
|
||||||
},
|
},
|
||||||
globals: { Buffer, JSON, Math, console, process },
|
globals: { Buffer, JSON, Math, console, process },
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,7 +2,7 @@ const sinon = require('sinon')
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const modulePath = '../../../app/js/DocArchiveManager.js'
|
const modulePath = '../../../app/js/DocArchiveManager.js'
|
||||||
const SandboxedModule = require('sandboxed-module')
|
const SandboxedModule = require('sandboxed-module')
|
||||||
const { ObjectId } = require('mongodb')
|
const { ObjectId } = require('mongodb-legacy')
|
||||||
const Errors = require('../../../app/js/Errors')
|
const Errors = require('../../../app/js/Errors')
|
||||||
|
|
||||||
describe('DocArchiveManager', function () {
|
describe('DocArchiveManager', function () {
|
||||||
|
|
|
@ -2,7 +2,7 @@ const SandboxedModule = require('sandboxed-module')
|
||||||
const sinon = require('sinon')
|
const sinon = require('sinon')
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const modulePath = require('path').join(__dirname, '../../../app/js/DocManager')
|
const modulePath = require('path').join(__dirname, '../../../app/js/DocManager')
|
||||||
const { ObjectId } = require('mongodb')
|
const { ObjectId } = require('mongodb-legacy')
|
||||||
const Errors = require('../../../app/js/Errors')
|
const Errors = require('../../../app/js/Errors')
|
||||||
|
|
||||||
describe('DocManager', function () {
|
describe('DocManager', function () {
|
||||||
|
|
|
@ -5,7 +5,7 @@ const modulePath = require('path').join(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../../../app/js/HttpController'
|
'../../../app/js/HttpController'
|
||||||
)
|
)
|
||||||
const { ObjectId } = require('mongodb')
|
const { ObjectId } = require('mongodb-legacy')
|
||||||
const Errors = require('../../../app/js/Errors')
|
const Errors = require('../../../app/js/Errors')
|
||||||
|
|
||||||
describe('HttpController', function () {
|
describe('HttpController', function () {
|
||||||
|
|
|
@ -4,7 +4,7 @@ const modulePath = require('path').join(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../../../app/js/MongoManager'
|
'../../../app/js/MongoManager'
|
||||||
)
|
)
|
||||||
const { ObjectId } = require('mongodb')
|
const { ObjectId } = require('mongodb-legacy')
|
||||||
const { assert, expect } = require('chai')
|
const { assert, expect } = require('chai')
|
||||||
const Errors = require('../../../app/js/Errors')
|
const Errors = require('../../../app/js/Errors')
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ const modulePath = require('path').join(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../../../app/js/RangeManager'
|
'../../../app/js/RangeManager'
|
||||||
)
|
)
|
||||||
const { ObjectId } = require('mongodb')
|
const { ObjectId } = require('mongodb-legacy')
|
||||||
|
|
||||||
describe('RangeManager', function () {
|
describe('RangeManager', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
"diff-match-patch": "overleaf/diff-match-patch#89805f9c671a77a263fc53461acd62aa7498f688",
|
"diff-match-patch": "overleaf/diff-match-patch#89805f9c671a77a263fc53461acd62aa7498f688",
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mongodb": "^6.2.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"requestretry": "^7.1.0"
|
"requestretry": "^7.1.0"
|
||||||
|
|
|
@ -4,6 +4,9 @@ const sinonChai = require('sinon-chai')
|
||||||
const SandboxedModule = require('sandboxed-module')
|
const SandboxedModule = require('sandboxed-module')
|
||||||
const sinon = require('sinon')
|
const sinon = require('sinon')
|
||||||
|
|
||||||
|
// ensure every ObjectId has the id string as a property for correct comparisons
|
||||||
|
require('mongodb-legacy').ObjectId.cacheHexString = true
|
||||||
|
|
||||||
// Chai configuration
|
// Chai configuration
|
||||||
chai.should()
|
chai.should()
|
||||||
chai.use(chaiAsPromised)
|
chai.use(chaiAsPromised)
|
||||||
|
@ -27,6 +30,7 @@ const stubs = {
|
||||||
SandboxedModule.configure({
|
SandboxedModule.configure({
|
||||||
requires: {
|
requires: {
|
||||||
'@overleaf/logger': stubs.logger,
|
'@overleaf/logger': stubs.logger,
|
||||||
|
'mongodb-legacy': require('mongodb-legacy'), // for ObjectId comparisons
|
||||||
},
|
},
|
||||||
globals: { Buffer, JSON, Math, console, process },
|
globals: { Buffer, JSON, Math, console, process },
|
||||||
})
|
})
|
||||||
|
|
3
services/filestore/.mocharc.json
Normal file
3
services/filestore/.mocharc.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"require": "test/setup.js"
|
||||||
|
}
|
34
services/filestore/test/setup.js
Normal file
34
services/filestore/test/setup.js
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
const sinon = require('sinon')
|
||||||
|
const SandboxedModule = require('sandboxed-module')
|
||||||
|
|
||||||
|
// ensure every ObjectId has the id string as a property for correct comparisons
|
||||||
|
require('mongodb').ObjectId.cacheHexString = true
|
||||||
|
|
||||||
|
const sandbox = sinon.createSandbox()
|
||||||
|
const stubs = {
|
||||||
|
logger: {
|
||||||
|
debug: sandbox.stub(),
|
||||||
|
log: sandbox.stub(),
|
||||||
|
info: sandbox.stub(),
|
||||||
|
warn: sandbox.stub(),
|
||||||
|
err: sandbox.stub(),
|
||||||
|
error: sandbox.stub(),
|
||||||
|
fatal: sandbox.stub(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
SandboxedModule.configure({
|
||||||
|
requires: {
|
||||||
|
'@overleaf/logger': stubs.logger,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
exports.mochaHooks = {
|
||||||
|
beforeEach() {
|
||||||
|
this.logger = stubs.logger
|
||||||
|
},
|
||||||
|
|
||||||
|
afterEach() {
|
||||||
|
sandbox.reset()
|
||||||
|
},
|
||||||
|
}
|
|
@ -6,20 +6,16 @@ const { FailedCommandError } = require('../../../app/js/Errors')
|
||||||
const SandboxedModule = require('sandboxed-module')
|
const SandboxedModule = require('sandboxed-module')
|
||||||
|
|
||||||
describe('ImageOptimiser', function () {
|
describe('ImageOptimiser', function () {
|
||||||
let ImageOptimiser, SafeExec, logger
|
let ImageOptimiser, SafeExec
|
||||||
const sourcePath = '/wombat/potato.eps'
|
const sourcePath = '/wombat/potato.eps'
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
SafeExec = {
|
SafeExec = {
|
||||||
promises: sinon.stub().resolves(),
|
promises: sinon.stub().resolves(),
|
||||||
}
|
}
|
||||||
logger = {
|
|
||||||
warn: sinon.stub(),
|
|
||||||
}
|
|
||||||
ImageOptimiser = SandboxedModule.require(modulePath, {
|
ImageOptimiser = SandboxedModule.require(modulePath, {
|
||||||
requires: {
|
requires: {
|
||||||
'./SafeExec': SafeExec,
|
'./SafeExec': SafeExec,
|
||||||
'@overleaf/logger': logger,
|
|
||||||
'@overleaf/metrics': {
|
'@overleaf/metrics': {
|
||||||
Timer: sinon.stub().returns({ done: sinon.stub() }),
|
Timer: sinon.stub().returns({ done: sinon.stub() }),
|
||||||
},
|
},
|
||||||
|
@ -65,7 +61,7 @@ describe('ImageOptimiser', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should log a warning', function () {
|
it('should log a warning', function () {
|
||||||
expect(logger.warn).to.have.been.calledOnce
|
expect(this.logger.warn).to.have.been.calledOnce
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -4,6 +4,9 @@ const config = require('config')
|
||||||
const fetch = require('node-fetch')
|
const fetch = require('node-fetch')
|
||||||
const { knex, mongodb } = require('../storage')
|
const { knex, mongodb } = require('../storage')
|
||||||
|
|
||||||
|
// ensure every ObjectId has the id string as a property for correct comparisons
|
||||||
|
require('mongodb').ObjectId.cacheHexString = true
|
||||||
|
|
||||||
chai.use(chaiAsPromised)
|
chai.use(chaiAsPromised)
|
||||||
|
|
||||||
async function setupPostgresDatabase() {
|
async function setupPostgresDatabase() {
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
"bunyan": "^1.8.15",
|
"bunyan": "^1.8.15",
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"method-override": "^3.0.0",
|
"method-override": "^3.0.0",
|
||||||
"mongodb": "^6.1.0",
|
|
||||||
"mongodb-legacy": "^6.0.1",
|
"mongodb-legacy": "^6.0.1",
|
||||||
"request": "^2.88.2"
|
"request": "^2.88.2"
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,6 +4,9 @@ const SandboxedModule = require('sandboxed-module')
|
||||||
// Chai configuration
|
// Chai configuration
|
||||||
chai.should()
|
chai.should()
|
||||||
|
|
||||||
|
// ensure every ObjectId has the id string as a property for correct comparisons
|
||||||
|
require('mongodb-legacy').ObjectId.cacheHexString = true
|
||||||
|
|
||||||
// SandboxedModule configuration
|
// SandboxedModule configuration
|
||||||
SandboxedModule.configure({
|
SandboxedModule.configure({
|
||||||
requires: {
|
requires: {
|
||||||
|
@ -16,6 +19,7 @@ SandboxedModule.configure({
|
||||||
error() {},
|
error() {},
|
||||||
fatal() {},
|
fatal() {},
|
||||||
},
|
},
|
||||||
|
'mongodb-legacy': require('mongodb-legacy'), // for ObjectId comparisons
|
||||||
},
|
},
|
||||||
globals: { Buffer, JSON, console, process },
|
globals: { Buffer, JSON, console, process },
|
||||||
})
|
})
|
||||||
|
|
|
@ -15,7 +15,7 @@ const { expect } = require('chai')
|
||||||
const modulePath = '../../../app/js/Notifications.js'
|
const modulePath = '../../../app/js/Notifications.js'
|
||||||
const SandboxedModule = require('sandboxed-module')
|
const SandboxedModule = require('sandboxed-module')
|
||||||
const assert = require('assert')
|
const assert = require('assert')
|
||||||
const { ObjectId } = require('mongodb')
|
const { ObjectId } = require('mongodb-legacy')
|
||||||
|
|
||||||
const userId = '51dc93e6fb625a261300003b'
|
const userId = '51dc93e6fb625a261300003b'
|
||||||
const notificationId = '574ee8d6f40c3a244e704249'
|
const notificationId = '574ee8d6f40c3a244e704249'
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
import chai from 'chai'
|
import chai from 'chai'
|
||||||
import sinonChai from 'sinon-chai'
|
import sinonChai from 'sinon-chai'
|
||||||
import chaiAsPromised from 'chai-as-promised'
|
import chaiAsPromised from 'chai-as-promised'
|
||||||
|
import mongodb from 'mongodb-legacy'
|
||||||
|
const { ObjectId } = mongodb
|
||||||
|
|
||||||
|
// ensure every ObjectId has the id string as a property for correct comparisons
|
||||||
|
ObjectId.cacheHexString = true
|
||||||
|
|
||||||
// Chai configuration
|
// Chai configuration
|
||||||
chai.should()
|
chai.should()
|
||||||
|
|
Loading…
Reference in a new issue