Skip to content

Commit

Permalink
cloud-sql/mysql to mocha (#1237)
Browse files Browse the repository at this point in the history
  • Loading branch information
AVaksman authored and fhinkel committed Apr 4, 2019
1 parent 92becb0 commit 1c8d086
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cloud-sql/mysql/mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"node": ">=8"
},
"scripts": {
"system-test": "ava --verbose test/*.test.js",
"system-test": "mocha test/*.test.js --timeout=60000 --exit",
"all-test": "npm run system-test"
},
"dependencies": {
Expand All @@ -27,7 +27,7 @@
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "^3.2.0",
"ava": "^0.25.0",
"mocha": "^6.0.0",
"proxyquire": "^2.1.0",
"supertest": "^4.0.0",
"sinon": "^7.1.1"
Expand Down
16 changes: 8 additions & 8 deletions cloud-sql/mysql/mysql/test/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

'use strict';

const request = require(`supertest`);
const sinon = require(`sinon`);
const test = require(`ava`);
const tools = require(`@google-cloud/nodejs-repo-tools`);
const request = require('supertest');
const sinon = require('sinon');
const assert = require('assert');
const tools = require('@google-cloud/nodejs-repo-tools');

// Stub out MySQL calls
const stubMysql = sinon.stub(require('promise-mysql'));
Expand All @@ -31,15 +31,15 @@ stubMysql.createPool.returns(poolStub);

const server = require('../server.js');

test.beforeEach(tools.stubConsole);
test.afterEach.always(tools.restoreConsole);
beforeEach(tools.stubConsole);
afterEach(tools.restoreConsole);

test(`check index page`, async t => {
it('check index page', async () => {
const response = await request(server)
.get('/')
.timeout(1000);

t.is(response.status, 200);
assert.strictEqual(response.status, 200);
});

server.close();

0 comments on commit 1c8d086

Please sign in to comment.