Prepare tests to run with browserify

This commit is contained in:
Raul Ochoa 2014-12-09 15:46:03 +01:00
parent e8634abc0d
commit 86dd178abb
9 changed files with 528 additions and 11 deletions

View File

@ -26,8 +26,10 @@ dist_folder:
dist: dist_folder dist/torque.js
prepare-test-suite:
browserify test/suite.js > test/suite-bundle.js
clean:
rm -rf dist
.PHONY: clean dist_folder

View File

@ -1,4 +1,6 @@
module('torque.core.Event');
var torque = require('../lib/torque');
QUnit.module('torque.core.Event');
function TestObj(){}
TestObj.prototype = torque.Event;

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,10 @@
var torque = require('../lib/torque');
var providers = torque.providers;
var json, url;
module('provider.json')
QUnit.module('provider.json');
QUnit.testStart(function() {
json = new torque.providers.json({
json = new providers.json({
table: 'test',
user: "rambo",
resolution: 1,

View File

@ -1,5 +1,7 @@
var torque = require('../lib/torque/core');
var jsonarray_fixture = require('./data/torque.array.json');
module('provider.jsonarray');
QUnit.module('provider.jsonarray');
test("processTile", function() {
var json = new torque.providers.JsonArray({

View File

@ -1,7 +1,9 @@
var torque = require('../lib/torque/core');
var windshaft, url;
var lastCall;
var old_net;
module('provider.windshaft', {
QUnit.module('provider.windshaft', {
setup: function() {
old_net = torque.net.jsonp;
old_get = torque.net.get;

View File

@ -1,4 +1,6 @@
module('renderer/point');
var torque = require('../../lib/torque');
QUnit.module('renderer/point');
var DEFAULT_CARTOCSS = [
'Map {',

View File

@ -1,6 +1,8 @@
module('request')
var torque = require('../lib/torque/core');
asyncTest("json", 6, function() {
QUnit.module('request');
asyncTest("json", 6, function(assert) {
var called = null;
torque.net.jsonp('http://test.com?callback=?', function(test) {
called = arguments;

View File

@ -1,5 +1,6 @@
var torque = require('../lib/torque/core');
module('torque');
QUnit.module('torque');
test('gets metadata from cartocss', function() {