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
3
votes
1 answer

Intern functional testing: skip a suite/test

I'm writing some functional tests using Intern/Leadfoot. These tests are end-to-end tests (called also stories) and between them there kind of data dependency. With that I mean that a test (ie. test2) will fail if the previous test (test1) did not…
Bruno Bruzzano
  • 477
  • 7
  • 21
3
votes
2 answers

How to require modules for testing NodeJS with Intern JS?

I'm getting the error Attempt to require unloaded module xxxxxx with the following intern.js test (myfile.js below does a require('xxxxxx')) for testing NodeJS. define(function(require) { var bdd = require('intern!bdd'); var myfile =…
user779159
  • 9,034
  • 14
  • 59
  • 89
3
votes
0 answers

leadfoot vs webdriver.io - javascript client library for selenium WebDriver API

What is the difference between intern's leadfoot and webdriver.io? Would appreciate, if some one can list down the pros and cons of both? Leadfoot - https://github.com/theintern/leadfoot webdriver.io - http://webdriver.io/
3
votes
0 answers

In intern, subsequent test suites reuse browser/session

In Intern, testsuites re-use the browser from the prior test suite. Although I can see the benefit of this in certain instances, I'm wondering if there is a way to set up the teardown/setup within the test suites so that the browser is closed upon…
aaronbriel
  • 301
  • 3
  • 11
3
votes
1 answer

Functional testing conditionals with Intern/Leadfoot

I am wishing to conditionally execute some commands/assertions depending on whether previous assertions succeeded or not. I can't seem to find a way to nest then calls or conditionally execute things using the chaining syntax of leadfoot. Here is my…
Michael
  • 5,994
  • 7
  • 44
  • 56
3
votes
1 answer

Testing drag and drop with Leadfoot

We are testing a simple drag and drop behaviour with Intern and the excellent new Leadfoot client library. Our requirement is simple: Find an element and move to it Press the mouse button (pick up the draggable item) Find another element and move…
indigoi
  • 142
  • 11
3
votes
1 answer

How to report JavaScript errors during functional tests using Intern?

How can I report JavaScript errors that occur during test execution using Intern? Basically, if there are any JavaScript errors on the page (even as part of things that aren't explicitly tested) I want to know. Background I'm just getting started…
jon_wu
  • 1,113
  • 11
  • 26
3
votes
2 answers

Unable to set baseUrl for intern-runner

My project follows the following (simplified) directory structure: \ |- app |- script1.js |- script2.js |- test |- intern.conf.js |- test.spec.js I'm using requirejs in my application and thus all scripts under app/ directory have…
Filipe Miguel Fonseca
  • 6,400
  • 1
  • 31
  • 26
3
votes
2 answers

intern.js and Browserstack

Intern.js is a great testrunner but it only appears to work with SauceLabs. My company already uses BrowserStack and are very happy with it. I was wondering if anyone has been able to integrate Intern.js with BrowserStack and if so how?
pyrzak
  • 63
  • 5
3
votes
1 answer

Can't load modules for Intern testing while using Browserify

I am trying to use Intern to unit test one of my modules, tested.js, which has a dependency on another module, dependency.js. Because I am using Browserify, tested.js includes the line: var dep = require('./lib/dependency.js'); Intern throws the…
fblundun
  • 987
  • 7
  • 19
3
votes
1 answer

Generating code coverage report using theIntern

I am using theIntern for unit testing my javascript framework. My test is running fine using node. However, I am not able to generate code coverage report properly. I tried the options provided in the documentation. I was successful to print code…
3
votes
1 answer

How to run intern to test a dojo application running with node.js ?

I'm trying to use intern to test a dojo application running under node.js My intern.js configuration file is something like: define({ loader: { packages: [ { name: 'elenajs', location: 'lib' }, …
kiuma
  • 881
  • 6
  • 5
3
votes
2 answers

How do async tests work in intern?

How do asynchronous tests work in Intern testing framework? I have tried to get them run exactly as in the example, but the async test passes immediately without waiting for the callback to be run. it('should connect in 5 seconds', function () { …
Pavel S.
  • 11,892
  • 18
  • 75
  • 113
3
votes
1 answer

Testing custom JavaScript (not Node module) with Intern

Is it possible to create and run test suites for custom client-side JavaScript, not created as Node modules? How should the configuration be altered then? There is loader section in the Intern configuration, specifying the packages that will be…
Pavel S.
  • 11,892
  • 18
  • 75
  • 113
2
votes
1 answer

Python string intern mechanism

I'm studying the python string intern mechanism. While I was doing some test like this: # short str list_short_str = ['0', str(0), chr(48), ''.join(['0']), '0'.join(('','')), '230'[-1:], ''+'0'+'', 'aaa0a'.strip('a')] print("short str id:") for…
wangjianyu
  • 97
  • 4
1 2
3
37 38