Skip to content

Commit

Permalink
Integration test improvements (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiranya911 committed Sep 14, 2018
1 parent 16e7fb9 commit d4a88f4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -14,7 +14,7 @@
"test": "run-s lint test:unit",
"integration": "run-s build test:integration",
"test:unit": "mocha test/unit/*.spec.ts --require ts-node/register",
"test:integration": "mocha test/integration/*.ts --slow 5000 --timeout 5000 --require ts-node/register",
"test:integration": "mocha test/integration/*.ts --slow 5000 --timeout 20000 --require ts-node/register",
"test:coverage": "nyc npm run test:unit",
"lint:src": "tslint --format stylish -p tsconfig.json",
"lint:unit": "tslint -c tslint-test.json --format stylish test/unit/*.ts test/unit/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion test/integration/auth.spec.ts
Expand Up @@ -220,7 +220,7 @@ describe('admin.auth', () => {
return admin.auth().verifyIdToken(idToken, true)
.should.eventually.be.fulfilled;
});
}).timeout(10000);
});

it('setCustomUserClaims() sets claims that are accessible via user\'s ID token', () => {
// Set custom claims on the user.
Expand Down
8 changes: 4 additions & 4 deletions test/integration/firestore.spec.ts
Expand Up @@ -65,7 +65,7 @@ describe('admin.firestore', () => {
.then((snapshot) => {
expect(snapshot.exists).to.be.false;
});
}).timeout(5000);
});

it('admin.firestore.FieldValue.serverTimestamp() provides a server-side timestamp', () => {
const expected: any = clone(mountainView);
Expand All @@ -81,7 +81,7 @@ describe('admin.firestore', () => {
return reference.delete();
})
.should.eventually.be.fulfilled;
}).timeout(5000);
});

it('admin.firestore.CollectionReference type is defined', () => {
expect(typeof admin.firestore.CollectionReference).to.be.not.undefined;
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('admin.firestore', () => {
return Promise.all(promises);
})
.should.eventually.be.fulfilled;
}).timeout(5000);
});

it('admin.firestore.setLogFunction() enables logging for the Firestore module', () => {
const logs = [];
Expand All @@ -147,5 +147,5 @@ describe('admin.firestore', () => {
.then((result) => {
expect(logs.length).greaterThan(0);
});
}).timeout(5000);
});
});
4 changes: 2 additions & 2 deletions test/integration/storage.spec.ts
Expand Up @@ -31,13 +31,13 @@ describe('admin.storage', () => {
const bucket: Bucket = admin.storage().bucket();
return verifyBucket(bucket, 'storage().bucket()')
.should.eventually.be.fulfilled;
}).timeout(5000);
});

it('bucket(string) returns a handle to the specified bucket', () => {
const bucket: Bucket = admin.storage().bucket(projectId + '.appspot.com');
return verifyBucket(bucket, 'storage().bucket(string)')
.should.eventually.be.fulfilled;
}).timeout(5000);
});

it('bucket(non-existing) returns a handle which can be queried for existence', () => {
const bucket: Bucket = admin.storage().bucket('non.existing');
Expand Down
4 changes: 4 additions & 0 deletions test/integration/typescript/src/example.test.ts
Expand Up @@ -26,6 +26,10 @@ const serviceAccount = require('../mock.key.json');
describe('Init App', () => {
const app: admin.app.App = initApp(serviceAccount, 'TestApp');

after(() => {
return app.delete();
});

it('Should return an initialized App', () => {
expect(app.name).to.equal('TestApp');
});
Expand Down

0 comments on commit d4a88f4

Please sign in to comment.