Skip to content

Commit

Permalink
test(create-npm): Use proper path to created repo
Browse files Browse the repository at this point in the history
  • Loading branch information
vinsonchuong committed Jan 4, 2021
1 parent a8f219e commit b5241f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bin/create-npm.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import test from 'ava'
import childProcess from 'child_process'
import {promisify} from 'util'
import path from 'path'
import {v1 as uuid} from 'uuid'
import {run} from '../../test/helpers/index.js'
import {withDirectory} from '../../test/fixtures/index.js'
Expand All @@ -15,6 +16,7 @@ test('bootstrapping an npm package project', async (t) => {
const {directory} = t.context

const repoName = `vinsonchuong/${uuid()}`
const [, packageName] = repoName.split('/')

const githubToken = process.env.GITHUB_TOKEN
const npmToken = process.env.NPM_TOKEN
Expand All @@ -38,9 +40,9 @@ test('bootstrapping an npm package project', async (t) => {
await deleteRepo(await authenticate(githubToken), repoName)
})

await exec('yarn test', {cwd: directory})
await exec('yarn test', {cwd: path.join(directory, packageName)})

const commits = await getCommits(directory)
const commits = await getCommits(path.join(directory, packageName))
t.true(
commits[0].includes('origin/master') ||
commits[0].includes('HEAD -> master')
Expand Down

0 comments on commit b5241f5

Please sign in to comment.