@@ -1144,18 +1144,24 @@ describe('merklize document with ipfs context', () => {
1144
1144
// node --experimental-vm-modules node_modules/jest/bin/jest.js -t 'set kubo client' tests/merklization.test.ts
1145
1145
1146
1146
const ipfsNodeURL = process . env . IPFS_URL ?? null ;
1147
+ const ipfsGatewayURL = process . env . IPFS_GATEWAY_URL ?? null ;
1148
+
1147
1149
if ( ! ipfsNodeURL ) {
1148
- throw new Error ( 'IPFS_URL is not set, skipping IPFS Node test' ) ;
1150
+ throw new Error ( 'IPFS_URL is not set' ) ;
1151
+ }
1152
+
1153
+ if ( ! ipfsGatewayURL ) {
1154
+ throw new Error ( 'IPFS_GATEWAY_URL is not set' ) ;
1149
1155
}
1150
1156
1151
1157
beforeAll ( async ( ) => {
1152
1158
await pushSchemasToIPFS ( ipfsNodeURL ) ;
1153
1159
} ) ;
1154
1160
1155
- it ( 'ipfs gateway is set' , async ( ) => {
1161
+ it ( 'ipfsNodeURL is set' , async ( ) => {
1156
1162
const opts = {
1157
1163
documentLoader : cacheLoader ( {
1158
- ipfsGatewayURL : process . env . IPFS_GATEWAY_URL
1164
+ ipfsNodeURL
1159
1165
} )
1160
1166
} ;
1161
1167
@@ -1168,7 +1174,7 @@ describe('merklize document with ipfs context', () => {
1168
1174
it ( 'ipfsGatewayURL is set' , async ( ) => {
1169
1175
const opts = {
1170
1176
documentLoader : cacheLoader ( {
1171
- ipfsGatewayURL : process . env . IPFS_GATEWAY_URL
1177
+ ipfsGatewayURL
1172
1178
} )
1173
1179
} ;
1174
1180
const mz : Merklizer = await Merklizer . merklizeJSONLD ( ipfsDocument , opts ) ;
@@ -1186,7 +1192,7 @@ describe('merklize document with ipfs context', () => {
1186
1192
it ( 'TestExistenceProofIPFS' , async ( ) => {
1187
1193
const opts = {
1188
1194
documentLoader : cacheLoader ( {
1189
- ipfsGatewayURL : process . env . IPFS_GATEWAY_URL
1195
+ ipfsGatewayURL
1190
1196
} )
1191
1197
} ;
1192
1198
const mz = await Merklizer . merklizeJSONLD ( testDocumentIPFS , opts ) ;
@@ -1217,7 +1223,6 @@ async function pushSchemasToIPFS(ipfsNodeURL: string): Promise<void> {
1217
1223
: { } ;
1218
1224
url . username = '' ;
1219
1225
url . password = '' ;
1220
- console . log ( 'url' , url . toString ( ) ) ;
1221
1226
1222
1227
return { url : url . toString ( ) , headers } ;
1223
1228
} ;
@@ -1238,7 +1243,6 @@ async function pushSchemasToIPFS(ipfsNodeURL: string): Promise<void> {
1238
1243
if ( records . length !== 2 ) {
1239
1244
throw new Error ( 'IPFS records not found' ) ;
1240
1245
}
1241
- console . log ( 'records' , records ) ;
1242
1246
} catch ( e ) {
1243
1247
console . warn ( 'try to upload document' , e ) ;
1244
1248
const citizenshipData = await readFile ( 'tests/testdata/citizenship-v1.jsonld' ) ;
0 commit comments