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

Fix samples tests #1323

Merged
merged 3 commits into from Sep 6, 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
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -66,10 +66,11 @@
"version": "33.0.0",
"scripts": {
"pretest": "npm run compile",
"prepare": "npm run compile",
"test": "nyc mocha build/test",
"docs": "echo no docs 👻 # typedoc --out docs src && touch docs/.nojekyll",
"system-test": "echo no system tests 👻",
"samples-test": "cd samples && npm link ../ && npm install && cd ../ && mocha build/test/samples",
"samples-test": "cd samples && npm link ../ && pwd && npm test",
"lint": "gts check && semistandard 'samples/**/*.js'",
"compile": "tsc -v && tsc -p . && copyfiles src/apis/**/README.md src/apis/**/package.json build",
"build-tools": "tsc -p tsconfig.tools.json",
Expand Down
6 changes: 6 additions & 0 deletions samples/package.json
Expand Up @@ -3,9 +3,15 @@
"description": "The following samples show basic usage of various APIs.",
"repository": "google/google-api-nodejs-client",
"license": "Apache-2.0",
"scripts": {
"test": "mocha ../build/test/samples"
},
"dependencies": {
"googleapis": "33.0.0",
"opn": "^5.3.0",
"server-destroy": "^1.0.1"
},
"devDependencies": {
"mocha": "^5.2.0"
}
}
2 changes: 1 addition & 1 deletion test/samples/test.samples.drive.ts
Expand Up @@ -35,7 +35,7 @@ for (const p in samples) {
}
}

const someFile = path.resolve('test/fixtures/public.pem');
const someFile = path.join(__dirname, '../../../test/fixtures/public.pem');

describe('Drive samples', () => {
afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/samples/test.samples.youtube.ts
Expand Up @@ -30,7 +30,7 @@ for (const p in samples) {
}
}

const someFile = path.resolve('test/fixtures/public.pem');
const someFile = path.join(__dirname, '../../../test/fixtures/public.pem');

describe('YouTube samples', () => {
afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/test.kitchen.ts
Expand Up @@ -61,7 +61,7 @@ describe('kitchen sink', async () => {
await mvp(tarball, `${stagingPath}/googleapis.tgz`);
await ncpp('test/fixtures/kitchen', `${stagingPath}/`);
await spawnp('npm', ['install'], {cwd: `${stagingPath}/`});
}).timeout(40000);
}).timeout(80000);
});

/**
Expand Down