Skip to content

Commit acfd48b

Browse files
committed
fix(create): Use filename without scope when generating imports from test file
1 parent aa6d3d0 commit acfd48b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎commands/create/index.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ class CreateCommand extends Command {
399399
writeTestFile() {
400400
const testContent = this.options.esModule
401401
? dedent`
402-
import ${this.camelName} from '../src/${this.pkgName}';
402+
import ${this.camelName} from '../src/${this.dirName}';
403403
404404
describe('${this.pkgName}', () => {
405405
it('needs tests');
@@ -424,15 +424,15 @@ class CreateCommand extends Command {
424424
this.options.esModule
425425
? dedent`
426426
import factory from 'yargs/yargs';
427-
import ${this.camelName} from './${this.pkgName}';
427+
import ${this.camelName} from './${this.dirName}';
428428
429429
export default cli;
430430
`
431431
: dedent`
432432
'use strict';
433433
434434
const yargs = require('yargs/yargs');
435-
const ${this.camelName} = require('./${this.pkgName}');
435+
const ${this.camelName} = require('./${this.dirName}');
436436
437437
module.exports = cli;
438438
`,

0 commit comments

Comments
 (0)