Skip to content

Commit

Permalink
Add question for app-dir tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Dec 19, 2022
1 parent e869869 commit 2bb473b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions plopfile.js
Expand Up @@ -6,6 +6,12 @@ module.exports = function (plop) {
plop.setGenerator('test', {
description: 'Create a new test',
prompts: [
{
type: 'confirm',
name: 'appDir',
message: 'Is this test for the app directory?',
default: false,
},
{
type: 'input',
name: 'name',
Expand Down Expand Up @@ -37,14 +43,18 @@ module.exports = function (plop) {
templateFile: `test/${
data.type === 'unit' ? 'unit' : 'e2e'
}/example.txt`,
path: `test/{{type}}/${fileName}/${fileName}.test.ts`,
path: `test/{{type}}/${
data.appDir ? 'app-dir/' : ''
}${fileName}/${fileName}.test.ts`,
},
{
type: 'add',
templateFile: `test/${
data.type === 'unit' ? 'unit' : 'e2e'
}/example-file.txt`,
path: `test/{{type}}/${fileName}/pages/index.js`,
path: `test/{{type}}/${
data.appDir ? 'app-dir/' : ''
}${fileName}/pages/index.js`,
},
]
},
Expand Down

0 comments on commit 2bb473b

Please sign in to comment.