V
V
veontomo2014-02-20 18:59:01
JavaScript
veontomo, 2014-02-20 18:59:01

BDD for Javascript on Windows

I didn't think it was such a problem, but I can't find a testing environment (BDD or acceptance test) for my application. I would like:
1. that tests can be written in javascript (for php I use PHPUnit with Behat / Mink, for Ruby - Cucumber),
2. to work under Windows without dancing with tambourines,
3. so that the tools are not outdated at the time of writing this question.
For TDD, I use Jasmine, which, in conjunction with Cucumber.js and Zombie, allows you to write BDD tests like

When I open page www.toster.ru
Then I should see answer on my question

The problem is that installing Zombie under Windows is almost impossible, as its authors admit .
Other tools (from those that I saw) only allow testing classes / functions, but do not imitate user behavior, as is possible, for example, in Behat or Cucumber.
Actually, the question is: do you know any program that would satisfy requirements 1-3?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
magic_ball, 2014-02-20
@veontomo

Look at mocha . Now it is the most popular and convenient framework for testing js applications. Great for both client and server side.
Supports BDD interface for writing tests visionmedia.github.io/mocha/#interfaces
I can't say 100% about windows, I don't work with it, but my colleagues had no problems.
I also advise you to take the full stack of related frameworks when choosing a mock:
mocha - directly for tests
chai - assertion framework for mocha, will allow you to use the whole variety of BDD checks chaijs.com/api/bdd
sinonjs if you need mocks for ajax requests
grunt and a plugin for mocka to make it easier to run tests, with the grunt-contrib-watch plugin, it will automatically restart tests on any change in js files and / or tests
and karma or testem to run tests in several browsers at once

F
fufnf, 2014-09-28
@fufnf

We use a bunch of selenium and node.js modules: cucumber.js + webdriver.io

H
hellboy1981, 2015-03-02
@hellboy1981

1) When should I write .feature specifications from cucumber.js?
2) If mocha with a BDD interface is used, then there is no need for cucumber?
3) What are the advantages of cucumber over mocha?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question