Questions tagged [buster.js]

BusterJS is a collection of related node.js modules that can run browser and node-based JavaScript tests.

Definition:

Buster.JS is an open source JavaScript testing framework.

Currently, Buster.JS can work in both browser and Node.js environments.

According to the Buster.JS GitHub Repository, the project has been abandoned.

Example Usage:

// Node.js tests
var buster = require("buster");
var myLib = require("../lib/my-lib");

buster.testCase("A module", {
    "states the obvious": function () {
        assert(true);
    }
});

Important Links:

36 questions
5
votes
1 answer

Buster.js - ReferenceError : assert is not defined, where I did wrong?

This is the error message: ReferenceError: assert is not defined at Object.buster.testCase.says hello to name var (./test/test-script.js:12:40) file config buster.js: var config = module.exports; config["myTests"] = { rootPath: "../", …
Donovant
  • 3,091
  • 8
  • 40
  • 68
5
votes
2 answers

Sinon.JS stub for window.location.search

I am trying to test a simple function that makes a call to window.location.search. I'm trying to understand how to stub this call so that I can return a url of my choosing. function: getParameterByName: (name) => name = name.replace(/[\[]/,…
Michael D Johnson
  • 889
  • 1
  • 10
  • 21
4
votes
1 answer

Has buster.js / sinon something like `jasmine.any()`?

Developing a callback-driven API, I would like to express that a certain function as to be called with a specific set of parameters and “any” function (the callback). Jasmine can do the following: var serviceFunction = jasmine.createSpy(); var…
David Aurelio
  • 484
  • 2
  • 11
3
votes
1 answer

buster.js testing cannot load my js-files

I've been banging my head at the wall since yesterday (only interrupted by a great Bruce Springsteen concert last night... ;-) I am trying to add some JS testing to an existing (Rails) project. Basically the folder structure is this: . ├── app │  …
Carsten Gehling
  • 1,218
  • 1
  • 13
  • 31
3
votes
2 answers

How can I use Require.js and Buster.js together?

I'm trying to get started with Buster.js, and I installed both buster and buster-amd, but even so my use of Require.js is causing problems. My buster.js file looks like this: var config = module.exports; config["My tests"] = { autoRun: false, …
machineghost
  • 33,529
  • 30
  • 159
  • 234
3
votes
1 answer

A Good Example On How to Use BusterJs Resource Config Option?

I'm looking for a good example that shows how to use busterJS's resource property in the buster.js config file to include a .json file in a test case. From the documentation: resources Additional resources that will be made available for test runs,…
Levi Hackwith
  • 9,232
  • 18
  • 64
  • 115
2
votes
3 answers

Expect this or that, how to include an OR in unit testing

I'm using buster.js and the "expect" assertions. I want the assertion to succeed in at least one of: expect(req.body.data._id).toBe('foo bar baz'); or expect(req.body.data.id).toBe('foo bar baz'); How can I do it?
R01010010
  • 5,670
  • 11
  • 47
  • 77
1
vote
1 answer

How can I pass env vars to buster.js?

I have a buster.js test. I need to pass some data to the test via an environment variable. How can I do this?
Matt Fichman
  • 5,458
  • 4
  • 39
  • 59
1
vote
1 answer

How do I hook onto suite:start / end with Buster.js?

I want to create a global setup/teardown method with Buster.js, but I can't understand how to do it. The documentation speaks of a "suit:start" and "suite:end"-event which looks like what I'm after, but I don't understand how to hook onto it.…
Nilzor
  • 18,082
  • 22
  • 100
  • 167
1
vote
1 answer

How to test with buster remote fetching file function, which works but works with callback

How to test function which fetch file from remote server with Buster ? I wrote test like buster.testCase("Remote fetch file", { "test it": function () { assert(true); }, "remote fetch file" : function (){ …
PaolaJ.
  • 10,872
  • 22
  • 73
  • 111
1
vote
1 answer

Issues using BusterJS, ExpressJS, and SuperTest

I'm having some issues testing routes using ExpressJS + BusterJS + SuperTest. var app = require("../../app/app.js"), buster = require("buster"), expect = buster.referee.expect, http = require('http'), request =…
Jack Slingerland
  • 2,651
  • 5
  • 34
  • 56
1
vote
1 answer

How do wildcards in BusterJS test paths get interpreted?

At the command line, what are the rules for using wildcards to specify the path to tests that BusterJS should run? How do such paths get interpreted by BusterJS? That is, the value provided for the option -t as in the following: $ buster-test -t…
Julian A.
  • 10,928
  • 16
  • 67
  • 107
1
vote
1 answer

Importing other .js files in Buster.js tests

I'm making my first attempt at Javascript testing, with Buster.js I've followed the instructions at the Buster site to run "states the obvious" test. However, I haven't been able to import any of my existing .js files into the tests. For instance, I…
scubbo
  • 4,969
  • 7
  • 40
  • 71
1
vote
1 answer

Buster JS - BDD style - set spec timeout

Using buster.js for BDD in javascript, I have some fairly hefty APIs to test. The default timeout isn't doing it for me under certain conditions. How do I override the default timeout for an (asynchronous) spec? describe("Given a request for all…
goofballLogic
  • 37,883
  • 8
  • 44
  • 62
1
vote
0 answers

BusterJS freezes when a lib is included

I have the following setup: buster.js: var config = module.exports; config["web-module"] = { autoRun: true, environment: "browser", rootPath: ".", libs: [ //"app/webroot/src/lib/underscore.js" ], sources: [ ], …
Pasukaru
  • 1,050
  • 1
  • 10
  • 22
1
2 3