Giter Club home page Giter Club logo

Comments (8)

mhevery avatar mhevery commented on June 14, 2024

I am not sure what you are doing, but jasmine-node is an adapter which takes the jasmine project and makes it run under node.js, so that you run your tests in node.js. No browsers are involved at all. I think you may be confusing this with jasmine directly?

from jasmine-node.

yonkeltron avatar yonkeltron commented on June 14, 2024

I am almost positive that the tests were running in the browser being served up by node. I know this because I viewed the tests in several different browsers (after starting jasmine mon) and they failed in every browser but Chrome with errors that certain functions did not exist. These came about because only Chrome uses v8.

from jasmine-node.

mhevery avatar mhevery commented on June 14, 2024

We must have some fundamental misunderstanding here. Jasmine is a testing library which runs on browsers. Node-jasmine is a port of it to node and uses no browsers (everything runs in node.js). See: https://github.com/mhevery/jasmine-node/blob/master/specs.sh

from jasmine-node.

yonkeltron avatar yonkeltron commented on June 14, 2024

Right so you've now touched on the issue. I feel like an idiot right now but just bear with me. When I started with jasmine-node, I thought it was (as your totally say) for executing specs in node instead of the browser. Upon using the jasmine command line tool, I was overjoyed to see output directed to the browser and it displayed properly in Chrome. There was much rejoicing. However, this elation was cut short the second I used a test which used require. I got an error. In fact, using any node-specific functions got me errors. On a whim, I tried using other browsers and found that many tests failed. I tried to see what the problem could be because tests shouldn't fail depending on what browsers are used to view the results, right? The errors indicated that the tests which failed were ones which either themself used ES5 feautures or tested code which did! Since tests which executed using node features failed and tests which executed ES5 features present in v8 failed on non-v8-powered browsers, I determined that the tests must only be served up by node for execution in the browser.

Now, maybe this conclusion is dead wrong. If that is the case, then there are other problems because errors can be caused by the above conditions.

from jasmine-node.

mhevery avatar mhevery commented on June 14, 2024

"Upon using the jasmine command line tool, I was overjoyed to see output directed to the browser and it displayed properly in Chrome."

What exactly did you type?

There are no browsers in node-jasmine. The very fact that you are looking at something in a browser means that you and me are not on the same page.

What is it that you want to achieve?
Run all tests in node? use node-jasmine.
Run test in browser? use jasmine

Browsers don't need node, and node does not need browsers.

from jasmine-node.

yonkeltron avatar yonkeltron commented on June 14, 2024

Ok, so upon closer examination, I see that npm install jasmine yields a different program from the one I am filing bugs on and, in fact and indeed, your wonderful software is not even available from npm at the current time.

I am sorry for wasting your time. While I'm here, do you have plans to make this available through npm? Sorry again...

from jasmine-node.

mhevery avatar mhevery commented on June 14, 2024

I think it would be nice if it would be available through npm, but I don't know enough about npm to have set it up.

from jasmine-node.

yonkeltron avatar yonkeltron commented on June 14, 2024

Actually, you are pretty much there!

  • npm init can help you get the package.json set up properly
  • npm publish will even publish it for you, etc.
  • You just need to make it so that the package.json knows that specs.js is an executable (in fact, rename it to jasmine-node or something)

I will gladly help test this before publishing, just let me know!

from jasmine-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.