BotBuilder-Samples icon indicating copy to clipboard operation
BotBuilder-Samples copied to clipboard

Remove "npm test" from all templates

Open compulim opened this issue 4 years ago • 1 comments

tl;dr all bot templates should not include an always-failing npm test script. It should work out of the box without any changes to any code.

Is your feature request related to a problem? Please describe.

I am trying to deploy a bot using Azure Web App Deployment Center. Here are my steps:

  1. Clone this repo
  2. Create a new repo, namely my-bot
  3. Copy /samples/javascript_nodejs/02.echo-bot/ recursively to my-bot repo at root level
  4. Commit my-bot to GitHub as main branch
  5. Create a new Azure Web App Bot
  6. Enable automatic deployment from GitHub from my-bot repo (in Azure Web App of the bot)

Then, it fail because the 02.echo-bot is trying to run npm run test --if-present, which failed.

> echo "Error: no test specified" && exit 1

"Error: no test specified" 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `echo "Error: no test specified" && exit 1`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Describe the solution you'd like

If 02.echo-bot doesn't come any test harness (e.g. Mocha/Jest), it should not include an always-failing "npm test" script.

Describe alternatives you've considered

  • Add a simple Mocha test
  • Remove it myself every time I clone the repo

Additional context

It is very reasonable for a CI/CD pipeline to run npm test to make sure the deployed bit looks okay. I think Azure Web App Deployment Center is doing it correctly by running npm test at deployment time.

compulim avatar Jun 30 '21 18:06 compulim

Ping.

compulim avatar Aug 28 '21 01:08 compulim

Old issue. But I think you mean the generators. These moved to JS, but appears to have been corrected there.

tracyboehrer avatar Mar 20 '24 15:03 tracyboehrer