-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
28 lines (23 loc) · 895 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Import the MaskUrl class
const MaskUrl = require('./index')
const MONGO_URL = "mongodb+srv://icop:[email protected]/Icop";
const PREFIX_URL = "https://links.xyzcompany.com";
const MASK_URL = "";
// describe('MaskUrl',()=>{
// test('generateUrl method should return a masked URL',async()=>{
// const urlMasker = new MaskUrl(MONGO_URL, PREFIX_URL);
// const maskedUrl = await urlMasker.connectToDatabase().then(()=>{
// return urlMasker.maskUrl(MASK_URL);
// })
// expect(maskedUrl.startsWith('')).toBe(true);
// })
// })
describe('MaskUrl',()=>{
test('generateUrl method should return a masked URL',async()=>{
const urlMasker = new MaskUrl(MONGO_URL, PREFIX_URL);
const maskedUrl = await urlMasker.connectToDatabase().then(()=>{
return urlMasker.fetchUrl("7sjtv");
})
expect(maskedUrl).toBe("test.com");
})
})