Closed jensim closed 6 years ago
Hello, @jensim. Thanks for pointing it out.
I moved some things around and might've forgotten about this one.
Can you please change the content of the travis file for the following:
language: node_js
node_js:
- "stable"
before_script:
- npm install -g typings typescript istanbul gulp-cli mocha
- typings install
- tsc
script:
- npm run test-server
services: mongodb
Just to see if travis didn't change a few things that used to work.
Also, keep in mind that if you're testing ng2 too, the build will fail because of #101.
Thanks for the information about #101
Build passed! =) https://travis-ci.org/jensim/myStreamWeb/builds/139450840
Right, but it didn't run any tests, though.
Can you try npm run test-server
locally, please? It should run 5 tests.
$ npm run test-server
> myStreamJS@0.0.1 test-server /Users/jensim/workspace-git/myStreamWeb
> mocha ./tests/server/**/*.js --recursive --check-leaks --reporter min --compilers js:babel-register
0 passing (2ms)
Not really sure what this tells us, the "0 passing" part is painted green.
PS This is a bit off topic though, this is related to #101
I'll investigate it when I get home.
So, I just ran the tests locally and got the following:
5 passing (194ms)
Do you have mocha
installed globally? If so, what's the version (mocha --version
)?
Also, when you're running the tests, do you have mongod
running? If not, you should.
That might be it.. At work now and am unable to check. I see now that mocha is declared in the wiki as a dependency for the node-server setting, could this be inserted into the generated README.md for the generated project?
npm i -g istanbul mocha babel gulp-cli
I mean, npm should pull the mocha
dependency in the package.json
: https://github.com/ericmdantas/generator-ng-fullstack/blob/master/app/templates/_package.json#L80, but it's good to know there's no conflict.
By the way, I just uninstalled mocha
globally, just running it locally and it still passes the tests.
Just for sanity check: You compiled the .ts
files (by running tsc
), you can use the app, but only the server tests aren't running, right?
I dont think i ran tsc... Could that be built in as a post install command or something (in the package.json)?
It runs when you run npm run dev
. But a postinstall is ideal, so we can run typings install
and tsc
.
But, did you manage to run the app?
I am having exactly the same problem. The app runs ok and using the modified .travis.yml above I can get the test passing on travis-ci.org but it reports 0 passing (2ms) in green. I get the same result running the server tests locally. I have the latest mocha installed globally (2.5.3), I have run tsc, I have mongod running..
Any ideas? thanks
@zerozero if you add a console.log('something')
in one of the tests, does it show in the terminal?
No there is nothing logged in the console from any of the tests or the before block
That's really weird. I'll try to reproduce it again.
Hi Eric - the problem is that 'due to shell expansion, glob patterns should be wrapped in single quotes on unix shells.' https://github.com/mochajs/mocha/issues/1115 so changing the test-server value to "test-server": "mocha './tests/server/*/.js' --recursive --check-leaks --reporter min --compilers js:babel-register" (note the single quotes around the glob pattern) fixes the tests Thanks
@zerozero: Oh, I'd never catch that one - thanks for pointing it out.
I'll fix it later today and release a patch.
1.8.17 released.
This is still not resolved. My .yo-rc.joson
{
"generator-ng-fullstack": {
"username": "SebaSOFT",
"appName": "AchievePlay",
"stack": "fullstack",
"server": "node",
"client": "ng1",
"transpilerServer": "node",
"secure": true,
"differentStaticServer": false
}
}
Also npm run test-server
doesn't run locally on Windows. I guess not all is platform agnostic.
Hey there, @SebaSOFT.
What happens when you run it? Do you have mongod
running?
fixed, its a couple of things.
Cool :smile:
https://travis-ci.org/jensim/myStreamWeb
My .yo-rc.json: