Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
Fix problem #150
Browse files Browse the repository at this point in the history
  • Loading branch information
davidedantonio committed Sep 27, 2020
1 parent 8c5a49b commit 4608245
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
40 changes: 20 additions & 20 deletions test/generate.project.swagger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,30 @@ const {
define(t)
})

function define (t) {
async function define (t) {
const { test } = t

test('should create project succesfully with given swagger file', async t => {
if (existsSync(workdir)) {
execSync(`rm -R ${workdir}`)
}
if (existsSync(workdir)) {
execSync(`rm -R ${workdir}`)
}

t.plan(30)
await run(
['create-fastify-app.js', 'generate:project', '-d', './test/workdirSwagger'],
[
`${APPLICATION_NAME}${ENTER}`,
`${APPLICATION_DESCRIPTION}${ENTER}`,
`${APPLICATION_AUTHOR}${ENTER}`,
`${APPLICATION_EMAIL}${ENTER}`,
`${APPLICATION_VERSION}${ENTER}`,
`${APPLICATION_KEYWORDS}${ENTER}`,
`${APPLICATION_LICENSE}${ENTER}`,
`${process.cwd()}/test/${SWAGGER_FILE}${ENTER}`,
`${ENTER}`
]
)
await run(
['create-fastify-app.js', 'generate:project', '-d', './test/workdirSwagger'],
[
`${APPLICATION_NAME}${ENTER}`,
`${APPLICATION_DESCRIPTION}${ENTER}`,
`${APPLICATION_AUTHOR}${ENTER}`,
`${APPLICATION_EMAIL}${ENTER}`,
`${APPLICATION_VERSION}${ENTER}`,
`${APPLICATION_KEYWORDS}${ENTER}`,
`${APPLICATION_LICENSE}${ENTER}`,
`${process.cwd()}/test/${SWAGGER_FILE}${ENTER}`,
`${ENTER}`
]
)

test('should create project succesfully with given swagger file', async t => {
t.plan(30)
await verifyPkgJson(t)
await verifyProjectSwaggerFolder(t)
})
Expand Down
40 changes: 20 additions & 20 deletions test/generate.project.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,30 @@ const {
define(t)
})

function define (t) {
async function define (t) {
const { test } = t

test('should create project succesfully', async (t) => {
if (existsSync(workdir)) {
execSync(`rm -R ${workdir}`)
}
if (existsSync(workdir)) {
execSync(`rm -R ${workdir}`)
}

t.plan(20)
await run(
['create-fastify-app.js', 'generate:project', '-d', './test/workdir'],
[
`${APPLICATION_NAME}${ENTER}`,
`${APPLICATION_DESCRIPTION}${ENTER}`,
`${APPLICATION_AUTHOR}${ENTER}`,
`${APPLICATION_EMAIL}${ENTER}`,
`${APPLICATION_VERSION}${ENTER}`,
`${APPLICATION_KEYWORDS}${ENTER}`,
`${APPLICATION_LICENSE}${ENTER}`,
`${SWAGGER_FILE_EMPTY}${ENTER}`,
`${ENTER}`
]
)
await run(
['create-fastify-app.js', 'generate:project', '-d', './test/workdir'],
[
`${APPLICATION_NAME}${ENTER}`,
`${APPLICATION_DESCRIPTION}${ENTER}`,
`${APPLICATION_AUTHOR}${ENTER}`,
`${APPLICATION_EMAIL}${ENTER}`,
`${APPLICATION_VERSION}${ENTER}`,
`${APPLICATION_KEYWORDS}${ENTER}`,
`${APPLICATION_LICENSE}${ENTER}`,
`${SWAGGER_FILE_EMPTY}${ENTER}`,
`${ENTER}`
]
)

test('should create project succesfully', async (t) => {
t.plan(20)
verifyPkgJson(t)
verifyProjectFolder(t)
})
Expand Down

0 comments on commit 4608245

Please sign in to comment.