Skip to content

Commit 6e16192

Browse files
committed
skipping tests using __dirname in production
1 parent 7224892 commit 6e16192

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

ajax-test.js

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,34 @@ QUnit = require('steal-qunit');
55

66
QUnit.module("can-util/dom/ajax");
77

8-
QUnit.asyncTest("basic get request", function () {
9-
ajax({
10-
type: "get",
11-
url: __dirname+"/test-result.json"
12-
}).then(function(resp){
13-
QUnit.equal(resp.message, "VALUE");
14-
start();
8+
if (__dirname !== '/') {
9+
QUnit.asyncTest("basic get request", function () {
10+
ajax({
11+
type: "get",
12+
url: __dirname+"/test-result.json"
13+
}).then(function(resp){
14+
QUnit.equal(resp.message, "VALUE");
15+
start();
16+
});
1517
});
16-
});
18+
}
1719

1820
QUnit.test("added to namespace (#99)", function(){
1921
QUnit.equal(namespace.ajax, ajax);
2022
});
2123

22-
QUnit.asyncTest("GET requests with dataType parse JSON (#106)", function(){
23-
ajax({
24-
type: "get",
25-
url: __dirname+"/test-result.txt",
26-
dataType: "json"
27-
}).then(function(resp){
28-
QUnit.equal(resp.message, "VALUE");
29-
start();
24+
if (__dirname !== '/') {
25+
QUnit.asyncTest("GET requests with dataType parse JSON (#106)", function(){
26+
ajax({
27+
type: "get",
28+
url: __dirname+"/test-result.txt",
29+
dataType: "json"
30+
}).then(function(resp){
31+
QUnit.equal(resp.message, "VALUE");
32+
start();
33+
});
3034
});
31-
});
35+
}
3236

3337
QUnit.asyncTest("ignores case of type parameter for a post request (#100)", function () {
3438
var oldXhr = window.XMLHttpRequest || window.ActiveXObject,
@@ -96,7 +100,7 @@ if(typeof XDomainRequest === 'undefined') {
96100
});
97101
}
98102

99-
if(System.env !== 'canjs-test') {
103+
if(System.env !== 'canjs-test' && __dirname !== '/') {
100104
// Brittle in IE 9
101105
QUnit.asyncTest("abort", function () {
102106
var promise = ajax({

0 commit comments

Comments
 (0)