computmaxer / karma-jspm

Other
74 stars 50 forks source link

CP-993 Basic example project #98

Closed poenneby closed 7 years ago

poenneby commented 8 years ago

Here's a basic example separating the sources from the tests

poenneby commented 8 years ago

Hey, anyone care to merge this pull request?

maxwellpeterson-wf commented 8 years ago

Looks good except for that one comment. @jayudey-wf can you test this when you have a chance?

trentgrover-wf commented 8 years ago

+1 @maxwellpeterson-wf @evanweible-wf

evanweible-wf commented 8 years ago

+1

MeoMix commented 8 years ago

Err.... sorry... maybe this is just me, but isn't it supposed to be "baseURL" not "baseUrl"? I feel like this is effectively not using a baseURL which, unsurprisingly, works fine..

poenneby commented 8 years ago

In the initial commit I had incorrectly added "baseUrl" to config.js but this was removed in my last commit. The goal of this project was to provide the simplest configuration to get people started. The issue with baseURL still exist but a possible solutions have been suggested here: https://github.com/Workiva/karma-jspm/issues/91#issuecomment-134994316 I still believe this example serves as a good starting point to explore solutions for the above mentioned issues... Sorry about any confusion.

maxwellpeterson-wf commented 8 years ago

+1

evanweible-wf commented 8 years ago

+1

trentgrover-wf commented 8 years ago

@jayudey-wf ready for merge

jayudey-wf commented 8 years ago

when trying to run the tests in the example i'm seeing this error @poenneby

npm run test

> basic@1.0.0 test /Users/jayudey/workiva/karma-jspm/examples/basic
> karma start

12 10 2015 10:08:17.773:INFO [karma]: Karma v0.13.10 server started at http://localhost:9876/
12 10 2015 10:08:17.779:INFO [launcher]: Starting browser PhantomJS
12 10 2015 10:08:18.619:INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket fCIQLtq5oXdGQtFYAAAA with id 80471356
12 10 2015 10:08:19.928:WARN [web-server]: 404: /base/stream/index.js
12 10 2015 10:08:20.046:WARN [web-server]: 404: /base/buffer.js
12 10 2015 10:08:20.047:WARN [web-server]: 404: /base/events.js
12 10 2015 10:08:20.047:WARN [web-server]: 404: /base/stream/index.js
12 10 2015 10:08:20.048:WARN [web-server]: 404: /base/util.js
12 10 2015 10:08:20.049:WARN [web-server]: 404: /base/jspm_packages/npm/string_decoder@0.10.31/
PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR: 'Potentially unhandled rejection [7] Error: XHR error (404 Not Found) loading http://localhost:9876/base/stream/index.js
    Error loading http://localhost:9876/base/stream/index.js as "stream/index" from http://localhost:9876/base/jspm_packages/npm/readable-stream@1.1.13/readable.js
    Error loading http://localhost:9876/base/test/hello.spec.js
    at http://localhost:9876/base/jspm_packages/system.src.js?4cf2029bbbbc9b776337cc3b2c67ab2beea97a00:740
    at tryCatchReject (http://localhost:9876/base/jspm_packages/system-polyfills.src.js?56a387e9b39188a3e391f91f0b045fcb0074ef81:1257)
    at runContinuation1 (http://localhost:9876/base/jspm_packages/system-polyfills.src.js?56a387e9b39188a3e391f91f0b045fcb0074ef81:1216)
    at http://localhost:9876/base/jspm_packages/system-polyfills.src.js?56a387e9b39188a3e391f91f0b045fcb0074ef81:1037
    at http://localhost:9876/base/jspm_packages/system-polyfills.src.js?56a387e9b39188a3e391f91f0b045fcb0074ef81:895
    at http://localhost:9876/base/jspm_packages/system-polyfills.src.js?56a387e9b39188a3e391f91f0b045fcb0074ef81:171
    at http://localhost:9876/base/jspm_packages/system-polyfills.src.js?56a387e9b39188a3e391f91f0b045fcb0074ef81:136'

12 10 2015 10:08:30.068:WARN [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.

npm ERR! basic@1.0.0 test: `karma start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the basic@1.0.0 test script.
npm ERR! This is most likely a problem with the basic package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     karma start
npm ERR! You can get their info via:
npm ERR!     npm owner ls basic
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 14.3.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "run" "test"
npm ERR! cwd /Users/jayudey/workiva/karma-jspm/examples/basic
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/jayudey/workiva/karma-jspm/examples/basic/npm-debug.log
npm ERR! not ok code 0
poenneby commented 8 years ago

@jayudey-wf I am not able to reproduce that error. Are you running

npm install
jspm install
npm run test

With empty node_modules and jspm_packages folders? I tried a jspm install just there followed by a jspm dl-loader --latest as I was getting warnings about babel version not being compatible with version of jspm. Don't know if it is related but worth rerunning those...

jayudey-wf commented 8 years ago

that command resolved a warning during my jspm install but I'm still un-able to run npm run test without encountering the aforementioned error

maxwellpeterson-wf commented 8 years ago

I'll give this a try

maxwellpeterson-wf commented 8 years ago

I can get past the error Jay is getting by removing config.js and running jspm install again (essentially generating a fresh config.js), but then I get stuck here:

> karma start

14 10 2015 10:49:09.792:INFO [karma]: Karma v0.13.10 server started at http://localhost:9876/
14 10 2015 10:49:09.799:INFO [launcher]: Starting browser PhantomJS
14 10 2015 10:49:10.842:INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket a6oqw6Azi6fobF89AAAA with id 75554839
PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR: 'Potentially unhandled rejection [7] TypeError: Attempted to assign to readonly property.
    Evaluating http://localhost:9876/base/jspm_packages/github/jmcriffey/bower-traceur@0.0.91/traceur.js
    Error loading http://localhost:9876/base/jspm_packages/github/jmcriffey/bower-traceur@0.0.91/traceur.js as "github:jmcriffey/bower-traceur@0.0.91/traceur" from http://localhost:9876/base/jspm_packages/github/jmcriffey/bower-traceur@0.0.91.js
    Error loading http://localhost:9876/base/test/hello.spec.js (WARNING: non-Error used)'

14 10 2015 10:49:21.078:WARN [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.

@poenneby what version of jspm are you running this with? I am on jspm 0.16.12.

poenneby commented 8 years ago

Same version as you: jspm -v 0.16.12 Running against local jspm install.

And the command works for me:

karma start 14 10 2015 21:30:01.209:INFO [karma]: Karma v0.13.10 server started at http://localhost:9876/ 14 10 2015 21:30:01.216:INFO [launcher]: Starting browser PhantomJS 14 10 2015 21:30:02.224:INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket BrXOIoeazoNsHH8OAAAA with id 71462043 PhantomJS 1.9.8 (Mac OS X 0.0.0): Executed 1 of 1 SUCCESS (0.003 secs / 0.001 secs)

On Wed, Oct 14, 2015 at 5:51 PM, Max Peterson notifications@github.com wrote:

I can get passed the error Jay is getting by removing config.js and running jspm install again (essentially generating a fresh config.js), but then I get stuck here:

karma start

14 10 2015 10:49:09.792:INFO [karma]: Karma v0.13.10 server started at http://localhost:9876/ 14 10 2015 10:49:09.799:INFO [launcher]: Starting browser PhantomJS 14 10 2015 10:49:10.842:INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket a6oqw6Azi6fobF89AAAA with id 75554839 PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR: 'Potentially unhandled rejection [7] TypeError: Attempted to assign to readonly property. Evaluating http://localhost:9876/base/jspm_packages/github/jmcriffey/bower-traceur@0.0.91/traceur.js Error loading http://localhost:9876/base/jspm_packages/github/jmcriffey/bower-traceur@0.0.91/traceur.js as "github:jmcriffey/bower-traceur@0.0.91/traceur" from http://localhost:9876/base/jspm_packages/github/jmcriffey/bower-traceur@0.0.91.js Error loading http://localhost:9876/base/test/hello.spec.js (WARNING: non-Error used)'

14 10 2015 10:49:21.078:WARN [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.

@poenneby https://github.com/poenneby what version of jspm are you running this with? I am on jspm 0.16.12.

— Reply to this email directly or view it on GitHub https://github.com/Workiva/karma-jspm/pull/98#issuecomment-148093951.

mhipszki commented 8 years ago

@poenneby I've cloned your fork and checked out the example project, for me it was working with the latest jspm 0.16.14 but running jspm install showed warnings, saying that dependencies are unsupported by this version of jspm:

$ jspm install
     Looking up npm:babel-core
     Looking up npm:babel-runtime
     Looking up npm:core-js
     Updating registry cache...
     Downloading npm:core-js@1.1.3
     Downloading npm:babel-runtime@5.8.20
     Downloading npm:babel-core@5.8.23
     Looking up github:jspm/nodelibs-process
ok   Installed babel as npm:babel-core@^5.8.22 (5.8.23)
     Looking up npm:process
ok   Installed github:jspm/nodelibs-process@^0.1.0 (0.1.1)
ok   Installed npm:process@^0.10.0 (0.10.1)
ok   Installed babel-runtime as npm:babel-runtime@^5.8.20 (5.8.20)
     Looking up github:systemjs/plugin-json
     Looking up github:jspm/nodelibs-fs
ok   Installed github:jspm/nodelibs-fs@^0.1.0 (0.1.2)
ok   Installed github:systemjs/plugin-json@^0.1.0 (0.1.0)
ok   Installed core-js as npm:core-js@^1.1.0 (1.1.3)
ok   Install tree has no forks.

warn babel@5.8.23 is unsupported for this version of jspm. Use jspm dl-loader --latest to update.

warn babel-runtime@5.8.20 is unsupported for this version of jspm. Use jspm dl-loader --latest to update.

warn core-js@1.1.3 is unsupported for this version of jspm. Use jspm dl-loader --latest to update.
     Looking up loader files...
       system.js.map
       system.src.js
       system.js
       system-csp-production.js
       system-csp-production.src.js
       system-polyfills.js
       system-csp-production.js.map
       system-polyfills.src.js
       system-polyfills.js.map

     Using loader versions:
       systemjs@0.19.5
ok   Loader files downloaded successfully

ok   Install complete.

I had to run jspm dl-loader --latest to update them, and as a result the config.js and the jspm related stuff in package.json was overwritten as @maxwellclarke-wf mentioned above

also, it'd be great to extend the example with jspm plugins or other github/npm packages wired up correctly as people seem struggling with that due to lack of working examples, see my comment here https://github.com/Workiva/karma-jspm/issues/82

@maxwellclarke-wf perhaps it'd be worth to extend the karma-jspm readme with some plugin wiring up tips?

poenneby commented 7 years ago

Hello! I'm doing some PR housekeeping - does this still interest anyone or can I close this PR? I must admit I have not used JSPM for a good while and this stuff may be totally outdated now...

mhipszki commented 7 years ago

@poenneby nope, feel free to close this one :)

poenneby commented 7 years ago

Thanks for confirming @mhipszki