Skip to content

Commit d3f825c

Browse files
authored
refactor(auth): convert ava tests to mocha (GoogleCloudPlatform#1146)
1 parent 91264c9 commit d3f825c

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

auth/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@
1212
"node": ">=8"
1313
},
1414
"scripts": {
15-
"test": "repo-tools test run --cmd ava -- -T 20s --verbose system-test/*.test.js"
15+
"test": "repo-tools test install --cmd=npm -- run system-test",
16+
"system-test": "mocha system-test/*.test.js --timeout=30000"
1617
},
1718
"dependencies": {
1819
"@google-cloud/storage": "^2.0.3",
1920
"yargs": "12.0.5"
2021
},
2122
"devDependencies": {
2223
"@google-cloud/nodejs-repo-tools": "^3.0.0",
23-
"ava": "0.25.0"
24+
"mocha": "^5.2.0"
2425
},
2526
"cloud-repo-tools": {
2627
"requiresKeyFile": true,

auth/system-test/auth.test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@
1515

1616
'use strict';
1717

18-
const path = require(`path`);
19-
const test = require(`ava`);
20-
const tools = require(`@google-cloud/nodejs-repo-tools`);
18+
const path = require('path');
19+
const assert = require('assert');
20+
const tools = require('@google-cloud/nodejs-repo-tools');
2121

22-
const cwd = path.join(__dirname, `..`);
23-
const cmd = `node auth.js`;
22+
const cwd = path.join(__dirname, '..');
23+
const cmd = 'node auth.js';
2424

25-
test.before(tools.checkCredentials);
25+
before(tools.checkCredentials);
2626

27-
test.serial(`should load credentials implicitly`, async t => {
27+
it('should load credentials implicitly', async () => {
2828
const output = await tools.runAsync(`${cmd} auth-cloud-implicit`, cwd);
29-
t.is(output.includes(`Buckets:`), true);
29+
assert.strictEqual(output.includes('Buckets:'), true);
3030
});
3131

32-
test.serial(`should load credentials explicitly`, async t => {
32+
it('should load credentials explicitly', async () => {
3333
const output = await tools.runAsync(`${cmd} auth-cloud-explicit`, cwd);
34-
t.is(output.includes(`Buckets:`), true);
34+
assert.strictEqual(output.includes('Buckets:'), true);
3535
});

0 commit comments

Comments
 (0)