Skip to content

Commit fcd1c01

Browse files
Fixed lint errors
1 parent 06cb2dc commit fcd1c01

File tree

5 files changed

+46
-47
lines changed

5 files changed

+46
-47
lines changed

lib/entity.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const create = ({ http, params }) => {
9090
this.stackHeaders = {
9191
...this.stackHeaders
9292
}
93-
93+
9494
const headers = {
9595
headers: {
9696
...cloneDeep(params),

lib/stack/deliveryToken/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export function DeliveryToken (http, data = {}) {
7676
this.previewToken = () => {
7777
return new PreviewToken(http, { stackHeaders: this.stackHeaders, token: { uid: this.uid } })
7878
}
79-
8079
} else {
8180
/**
8281
* @description The Create a DeliveryToken call creates a new deliveryToken in a particular stack of your Contentstack account.

lib/stack/deliveryToken/previewToken/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function PreviewToken (http, data = {}) {
3838
* .then((previewToken) => console.log(previewToken))
3939
*/
4040
this.create = create({ http: http })
41-
}
41+
}
4242
}
4343

4444
export function PreviewTokenCollection (http, data) {
@@ -47,4 +47,4 @@ export function PreviewTokenCollection (http, data) {
4747
return new PreviewToken(http, { token: userdata, stackHeaders: data.stackHeaders })
4848
})
4949
return previewTokenCollection
50-
}
50+
}

test/sanity-check/api/previewToken-test.js

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,87 +5,87 @@ import { createDeliveryToken3 } from '../mock/deliveryToken.js'
55
import { contentstackClient } from '../utility/ContentstackClient.js'
66
import dotenv from 'dotenv'
77

8-
dotenv.config();
9-
let client = {};
8+
dotenv.config()
9+
let client = {}
1010

11-
let tokenUID = "";
12-
describe("Preview Token api Test", () => {
11+
let tokenUID = ''
12+
describe('Preview Token api Test', () => {
1313
setup(() => {
14-
const user = jsonReader("loggedinuser.json");
15-
client = contentstackClient(user.authtoken);
16-
});
14+
const user = jsonReader('loggedinuser.json')
15+
client = contentstackClient(user.authtoken)
16+
})
1717

18-
it("should add a Delivery Token for development", (done) => {
18+
it('should add a Delivery Token for development', (done) => {
1919
makeDeliveryToken()
2020
.create(createDeliveryToken3)
2121
.then((token) => {
2222
tokenUID = token.uid
23-
expect(token.name).to.be.equal(createDeliveryToken3.token.name);
23+
expect(token.name).to.be.equal(createDeliveryToken3.token.name)
2424
expect(token.description).to.be.equal(
2525
createDeliveryToken3.token.description
26-
);
26+
)
2727
expect(token.scope[0].environments[0].name).to.be.equal(
2828
createDeliveryToken3.token.scope[0].environments[0]
29-
);
29+
)
3030
expect(token.scope[0].module).to.be.equal(
3131
createDeliveryToken3.token.scope[0].module
32-
);
33-
expect(token.uid).to.be.not.equal(null);
34-
expect(token.preview_token).to.be.not.equal(null);
35-
done();
32+
)
33+
expect(token.uid).to.be.not.equal(null)
34+
expect(token.preview_token).to.be.not.equal(null)
35+
done()
3636
})
37-
.catch(done);
38-
});
37+
.catch(done)
38+
})
3939

40-
it("should add a Preview Token", (done) => {
40+
it('should add a Preview Token', (done) => {
4141
makePreviewToken(tokenUID)
4242
.create()
4343
.then((token) => {
44-
expect(token.name).to.be.equal(createDeliveryToken3.token.name);
44+
expect(token.name).to.be.equal(createDeliveryToken3.token.name)
4545
expect(token.description).to.be.equal(
4646
createDeliveryToken3.token.description
47-
);
47+
)
4848
expect(token.scope[0].environments[0].name).to.be.equal(
4949
createDeliveryToken3.token.scope[0].environments[0]
50-
);
50+
)
5151
expect(token.scope[0].module).to.be.equal(
5252
createDeliveryToken3.token.scope[0].module
53-
);
54-
expect(token.uid).to.be.not.equal(null);
55-
expect(token.preview_token).to.be.not.equal(null);
56-
done();
53+
)
54+
expect(token.uid).to.be.not.equal(null)
55+
expect(token.preview_token).to.be.not.equal(null)
56+
done()
5757
})
58-
.catch(done);
59-
});
58+
.catch(done)
59+
})
6060

61-
it("should delete a Preview Token from uid", (done) => {
61+
it('should delete a Preview Token from uid', (done) => {
6262
makePreviewToken(tokenUID)
6363
.delete()
6464
.then((data) => {
65-
expect(data.notice).to.be.equal("Preview token deleted successfully.");
66-
done();
65+
expect(data.notice).to.be.equal('Preview token deleted successfully.')
66+
done()
6767
})
68-
.catch(done);
69-
});
68+
.catch(done)
69+
})
7070

71-
it("should delete a Delivery Token from uid", (done) => {
71+
it('should delete a Delivery Token from uid', (done) => {
7272
makeDeliveryToken(tokenUID)
7373
.delete()
7474
.then((data) => {
75-
expect(data.notice).to.be.equal("Delivery Token deleted successfully.");
76-
done();
75+
expect(data.notice).to.be.equal('Delivery Token deleted successfully.')
76+
done()
7777
})
78-
.catch(done);
79-
});
80-
});
78+
.catch(done)
79+
})
80+
})
8181

82-
function makePreviewToken(uid = null) {
82+
function makePreviewToken (uid = null) {
8383
return client
8484
.stack({ api_key: process.env.API_KEY })
8585
.deliveryToken(uid)
86-
.previewToken();
86+
.previewToken()
8787
}
8888

89-
function makeDeliveryToken(uid = null) {
90-
return client.stack({ api_key: process.env.API_KEY }).deliveryToken(uid);
89+
function makeDeliveryToken (uid = null) {
90+
return client.stack({ api_key: process.env.API_KEY }).deliveryToken(uid)
9191
}

test/sanity-check/mock/deliveryToken.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const createDeliveryToken3 = {
8787
{
8888
module: 'branch',
8989
branches: [
90-
'main',
90+
'main'
9191
],
9292
acl: {
9393
read: true

0 commit comments

Comments
 (0)