Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update sample test dependencies #246

Merged
merged 1 commit into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 7 additions & 10 deletions samples/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "nodejs-docs-samples-logging-winston",
"files": ["*.js"],
"files": [
"*.js"
],
"private": true,
"license": "Apache-2.0",
"author": "Google Inc.",
Expand All @@ -13,16 +15,11 @@
},
"dependencies": {
"@google-cloud/logging-winston": "^0.10.2",
"winston": "^3.1.0",
"yargs": "^12.0.0"
"winston": "^3.1.0"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "^3.0.0",
"ava": "^0.25.0"
},
"ava": {
"require": [
"source-map-support/register"
]
"chai": "^4.2.0",
"execa": "^1.0.0",
"mocha": "^5.2.0"
}
}
2 changes: 1 addition & 1 deletion samples/setup_explicit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/* eslint-disable no-unused-vars */
// [START logging_winston_setup_explicit]
// Imports the Google Cloud client library for Winston
const LoggingWinston = require('@google-cloud/logging-winston').LoggingWinston;
const {LoggingWinston} = require('@google-cloud/logging-winston');

// Creates a client
const loggingWinston = new LoggingWinston({
Expand Down
20 changes: 9 additions & 11 deletions samples/system-test/quickstart.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@

'use strict';

const path = require(`path`);
const assert = require(`assert`);
const tools = require(`@google-cloud/nodejs-repo-tools`);
describe('QuickStart', () => {
before(tools.checkCredentials);
const path = require('path');
const {assert} = require('chai');
const execa = require('execa');

it(`should write using winston`, async () => {
const output = await tools.runAsync(
`node quickstart.js`,
path.join(__dirname, `..`)
);
assert.deepStrictEqual(output.includes('99%'), true);
describe('QuickStart', () => {
it('should write using winston', async () => {
const {stdout} = await execa.shell('node quickstart.js', {
cwd: path.join(__dirname, '..'),
});
assert.match(stdout, /99%/);
});
});