Skip to content

Commit

Permalink
fix: add teardown for unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
juanpicado committed Mar 11, 2018
1 parent 547da37 commit 036120b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions test/unit/api.pkg.access.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('api with no limited access configuration', () => {
let app;

beforeAll(function(done) {
const store = path.join(__dirname, '../partials/store/access-storage');
const store = path.join(__dirname, './partials/store/access-storage');
rimraf(store, () => {
const configForTest = _.clone(configDefault);
configForTest.auth = {
Expand All @@ -35,6 +35,17 @@ describe('api with no limited access configuration', () => {
});
});

afterAll(function(done) {
const store = path.join(__dirname, './partials/store/access-storage');
rimraf(store, (err) => {
if (err) {
return done(err);
}

return done();
});
});

describe('test proxy packages partially restricted', () => {

test('should test fails on fetch endpoint /-/jquery', (done) => {
Expand All @@ -51,9 +62,9 @@ describe('api with no limited access configuration', () => {
});
});

test('should success on fetch endpoint /-/react', (done) => {
test('should success on fetch endpoint /-/vue', (done) => {
request(app)
.get('/react')
.get('/vue')
.set('content-type', 'application/json; charset=utf-8')
.expect('Content-Type', /json/)
.expect(200)
Expand Down

0 comments on commit 036120b

Please sign in to comment.