mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-04-08 02:54:13 -05:00
fix: add teardown for unit test
This commit is contained in:
parent
547da379e9
commit
036120b777
1 changed files with 14 additions and 3 deletions
|
@ -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 = {
|
||||
|
@ -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) => {
|
||||
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue