Skip to content

Commit 357ce77

Browse files
committed
Fixed broken mocha tests.
1 parent cf2e0ab commit 357ce77

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

test/spec/test.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*jshint node:true, evil:true */
2-
/*global describe:true, it:true, PAYPAL:true, document:true, window:true, before:true */
2+
/*global describe:true, it:true, PAYPAL:true, document:true, window:true, before:true, beforeEach:true */
33

44
if (typeof window === 'undefined') {
55
var fs = require('fs'),
@@ -18,28 +18,34 @@ describe('JavaScript API', function () {
1818

1919
'use strict';
2020

21+
var namespace;
22+
23+
before(function () {
24+
namespace = PAYPAL;
25+
});
26+
2127
it('Should have a PAYPAL namespace', function () {
22-
PAYPAL.should.be.a('object');
28+
namespace.should.be.a('object');
2329
});
2430

2531
it('Should have a PAYPAL.apps namespace', function () {
26-
PAYPAL.apps.should.be.a('object');
32+
namespace.apps.should.be.a('object');
2733
});
2834

2935
it('Should have a PAYPAL.apps.ButtonFactory namespace', function () {
30-
PAYPAL.apps.ButtonFactory.should.be.a('object');
36+
namespace.apps.ButtonFactory.should.be.a('object');
3137
});
3238

3339
it('Should have a configuration object', function () {
34-
PAYPAL.apps.ButtonFactory.config.should.be.a('object');
40+
namespace.apps.ButtonFactory.config.should.be.a('object');
3541
});
3642

3743
it('Should have a create method', function () {
38-
PAYPAL.apps.ButtonFactory.create.should.be.a('function');
44+
namespace.apps.ButtonFactory.create.should.be.a('function');
3945
});
4046

4147
it('Create return false if no parameters', function () {
42-
var result = PAYPAL.apps.ButtonFactory.create();
48+
var result = namespace.apps.ButtonFactory.create();
4349

4450
result.should.equal(false);
4551
});

0 commit comments

Comments
 (0)