Skip to content

Commit

Permalink
fix: api changed
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyguerra committed Jun 18, 2024
1 parent b2a303b commit dd084f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ class HubotGenerator extends Generator {
this.log(hubotStartSay())
this.fs.copyTpl(this.templatePath('bin/hubot.cmd'), this.destinationPath('bin/hubot.cmd'), this.props)
this.fs.copyTpl(this.templatePath('bin/hubot'), this.destinationPath('bin/hubot'), this.props)
this.copyTemplate('scripts/', 'scripts/', null, this.props)
this.copyTemplate('scripts/', 'scripts/', undefined, this.props)
this.fs.copyTpl(this.templatePath('Procfile'), this.destinationPath('Procfile'), this.props)
this.fs.copyTpl(this.templatePath('README.md'), this.destinationPath('README.md'), this.props)
this.writeDestinationJSON('external-scripts.json', this.externalScripts)
this.copyTemplate('gitignore', '.gitignore', null, this.props)
this.copyTemplate('gitignore', '.gitignore', undefined, this.props)
this.fs.copyTpl(this.templatePath('_package.json'), this.destinationPath('package.json'), this.props)
}

Expand Down
19 changes: 11 additions & 8 deletions test/test-app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import assert from 'yeoman-assert'
import fs from 'node:fs/promises'
const __dirname = path.dirname(new URL(import.meta.url).pathname)

function getFullPath (file) {
return path.join(__dirname, '../test/temp', file)
}
describe('hubot:app', function () {
before(async () => {
await helpers.run(path.join(__dirname, '../generators/app'))
Expand All @@ -14,14 +17,14 @@ describe('hubot:app', function () {

it('creates files', async function () {
assert.file([
'bin/hubot',
'bin/hubot.cmd',
'Procfile',
'README.md',
'external-scripts.json',
'.gitignore',
'package.json',
'scripts/Example.mjs'
getFullPath('bin/hubot'),
getFullPath('bin/hubot.cmd'),
getFullPath('Procfile'),
getFullPath('README.md'),
getFullPath('external-scripts.json'),
getFullPath('.gitignore'),
getFullPath('package.json'),
getFullPath('scripts/Example.mjs')
])
assert.fileContent('bin/hubot', await fs.readFile(path.join(__dirname, '../test/temp/bin/hubot'), 'utf8'))
assert.fileContent('package.json', await fs.readFile(path.join(__dirname, '../test/temp/package.json'), 'utf8'))
Expand Down

0 comments on commit dd084f6

Please sign in to comment.