Questions tagged [intern]

A JavaScript testing framework.

Description

Intern is an open-source project hosted on GitHub. It is a complete test stack for JavaScript designed to help you write and run consistent, high-quality test cases for your JavaScript libraries and applications. It can be used to test any JavaScript code.

External links

556 questions
2
votes
1 answer

Issues with intern-runner and proxyUrl that contains subfolders

I need to setup intern to test ajax calls from a different server. I set everything up sort of following the official wiki in this address https://github.com/theintern/intern/wiki/Using-Intern-to-unit-test-Ajax-calls My config file has proxyUrl set…
Marco Luglio
  • 3,503
  • 1
  • 21
  • 27
2
votes
1 answer

Dojo versions and Intern compatibility

This should be an easy question for the Dojo and Intern gurus our there. What versions of dojo do the different versions of Intern work with without any core configuration changes required? For example I had come up against an issue recently where I…
Jeremy
  • 3,418
  • 2
  • 32
  • 42
2
votes
1 answer

How to recover from crashes/hangups with intern on Selenium Grid

I am running my intern unit tests on a Selenium 2 Grid. This works fine when all tests execute normally. Also a run-time error within a test is dealt with properly: the test is reported as failed and other tests continue to execute. Some other types…
2
votes
2 answers

How can I use dijit/regisrty in an Intern functional test

I am having problems using any dojo modules with my functional test, I keep seeing window not defined errors or document not defined. I am currently trying to use the dijit/registry like so (only importing its module so far).. define([ …
Jeremy
  • 3,418
  • 2
  • 32
  • 42
2
votes
1 answer

Running The Intern via standalone browser client misses this.remote in suites

This Test code: define([ 'intern!object', 'intern/chai!assert', 'require' ], function (registerSuite, assert, require) { registerSuite({ name: 'index', 'greeting form': function () { return this.remote …
BogdanBiv
  • 1,485
  • 1
  • 16
  • 33
2
votes
1 answer

Running intern with PhantomJS: window is undefined

I've followed all the steps described here: https://github.com/theintern/intern/wiki/Using-Intern-with-PhantomJS My intern config is ~ as follows: define({ proxyPort: 9000, proxyUrl: 'http://localhost:9000/', environments: [ { browserName:…
Georgii Ivankin
  • 2,702
  • 2
  • 23
  • 35
2
votes
1 answer

Intern: The environment you requested was unavailable

We are using Intern to test our application. We have three different Intern configuration files which we use to target either a local instance of Selenium, an instance running on a local virtual machine, or Sauce Labs. Intern runs tests against…
indigoi
  • 142
  • 11
2
votes
1 answer

Store a variable in Intern funcational test

How can you store a value from one element in an Intern functional test that can be used to find additional elements? For example, I have the following test snippet: var mainItem = "Menu 1"; var subItem = "Sub Menu 1"; var mainItemId = ""; …
AmanB
  • 23
  • 3
2
votes
1 answer

How can I access global JavaScript scope from Intern functional test?

How can you access the main JavaScript scope of the browser in a functional test? For example, I want to obtain a reference to a Dojo widget and check it's attributes. In a browser JavaScript console I could for example run: …
Dave Draper
  • 1,837
  • 11
  • 25
2
votes
2 answers

Is it possible to use dojo/text! in an Intern functional test?

Is it possible to use "dojo/text!" in an Intern functional test? I am able to setup my test page as a JSON string, but ideally I'd like to externalise the string in a file for ease of editing. I'm just getting started with Intern at the moment so…
Dave Draper
  • 1,837
  • 11
  • 25
2
votes
1 answer

Configuring Intern to setup/teardown my server mock

I am writing a test suite for a JavaScript widget using Intern. I have written some pure-JavaScript tests and some in-page DOM tests, but I'm a little stuck on how to write functional tests for the Ajax functionality, which should talk to my simple…
Alex Dean
  • 15,575
  • 13
  • 63
  • 74
2
votes
2 answers

How do you specify test suites in Intern using a wildcard?

I have a bunch of unit tests in this folder: src/app/tests/. Do I have to list them individually in intern.js or is there a way to use a wildcard? I've tried suites: [ 'src/app/tests/*' ] but that just causes the test runner to try to load…
Scott
  • 117
  • 7
2
votes
1 answer

Excluding files from coverage with intern, do I need a custom reporter?

I have a large project I'm writing intern tests against, I'm able to generate 90%+ coverage for my own package however coverage is being reported much less than this because other packages (such as dojo, dijit etc) are also being included in the…
lebod
  • 102
  • 1
  • 7
2
votes
2 answers

intern dojo loader issue

I'm trying to setup intern for my project, a Dojo/JS project, and the server is not Node... I get a loader issue, which seems to be due to dojo.has using Dojo loader... The require wrapper suggested in here did not work for me. I get the error…
stafamus
  • 509
  • 2
  • 9
2
votes
1 answer

Why is my intern test failing with "document is not defined"

I am new to Intern and struggling with trying to get a simple test to run in my environment. I was able to get the tutorial test to run but I've tried to set up a test where the test file is located inside my app directory hierarchy. The module…
teaman
  • 469
  • 7
  • 18