Skip to content

Commit d4a88f4

Browse files
authored
Integration test improvements (#356)
1 parent 16e7fb9 commit d4a88f4

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"test": "run-s lint test:unit",
1515
"integration": "run-s build test:integration",
1616
"test:unit": "mocha test/unit/*.spec.ts --require ts-node/register",
17-
"test:integration": "mocha test/integration/*.ts --slow 5000 --timeout 5000 --require ts-node/register",
17+
"test:integration": "mocha test/integration/*.ts --slow 5000 --timeout 20000 --require ts-node/register",
1818
"test:coverage": "nyc npm run test:unit",
1919
"lint:src": "tslint --format stylish -p tsconfig.json",
2020
"lint:unit": "tslint -c tslint-test.json --format stylish test/unit/*.ts test/unit/**/*.ts",

test/integration/auth.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ describe('admin.auth', () => {
220220
return admin.auth().verifyIdToken(idToken, true)
221221
.should.eventually.be.fulfilled;
222222
});
223-
}).timeout(10000);
223+
});
224224

225225
it('setCustomUserClaims() sets claims that are accessible via user\'s ID token', () => {
226226
// Set custom claims on the user.

test/integration/firestore.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('admin.firestore', () => {
6565
.then((snapshot) => {
6666
expect(snapshot.exists).to.be.false;
6767
});
68-
}).timeout(5000);
68+
});
6969

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

8686
it('admin.firestore.CollectionReference type is defined', () => {
8787
expect(typeof admin.firestore.CollectionReference).to.be.not.undefined;
@@ -132,7 +132,7 @@ describe('admin.firestore', () => {
132132
return Promise.all(promises);
133133
})
134134
.should.eventually.be.fulfilled;
135-
}).timeout(5000);
135+
});
136136

137137
it('admin.firestore.setLogFunction() enables logging for the Firestore module', () => {
138138
const logs = [];
@@ -147,5 +147,5 @@ describe('admin.firestore', () => {
147147
.then((result) => {
148148
expect(logs.length).greaterThan(0);
149149
});
150-
}).timeout(5000);
150+
});
151151
});

test/integration/storage.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ describe('admin.storage', () => {
3131
const bucket: Bucket = admin.storage().bucket();
3232
return verifyBucket(bucket, 'storage().bucket()')
3333
.should.eventually.be.fulfilled;
34-
}).timeout(5000);
34+
});
3535

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

4242
it('bucket(non-existing) returns a handle which can be queried for existence', () => {
4343
const bucket: Bucket = admin.storage().bucket('non.existing');

test/integration/typescript/src/example.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ const serviceAccount = require('../mock.key.json');
2626
describe('Init App', () => {
2727
const app: admin.app.App = initApp(serviceAccount, 'TestApp');
2828

29+
after(() => {
30+
return app.delete();
31+
});
32+
2933
it('Should return an initialized App', () => {
3034
expect(app.name).to.equal('TestApp');
3135
});

0 commit comments

Comments
 (0)