Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

migrated require tests to new testing format

  • Loading branch information...
commit d4e2d545104248df5860e9104064af62921848f2 1 parent 60c27d7
@n1k0 authored
Showing with 30 additions and 24 deletions.
  1. +30 −24 tests/suites/require.js
View
54 tests/suites/require.js
@@ -2,30 +2,36 @@
/*jshint strict:false*/
var fs = require('fs');
var modroot = fs.pathJoin(phantom.casperPath, 'tests', 'sample_modules');
-var jsmod, csmod, config;
-casper.test.comment('Javascript module loading')
-try {
- jsmod = require(fs.pathJoin(modroot, 'jsmodule'));
- casper.test.assertTrue(jsmod.ok, 'require() patched version can load a js module');
-} catch (e) {
- casper.test.fail('require() patched version can load a js module');
-}
+casper.test.begin('Javascript module loading', 1, function(test) {
+ var jsmod;
+ try {
+ jsmod = require(fs.pathJoin(modroot, 'jsmodule'));
+ test.assertTrue(jsmod.ok, 'require() patched version can load a js module');
+ } catch (e) {
+ test.fail('require() patched version can load a js module');
+ }
+ test.done();
+});
-casper.test.comment('CoffeeScript module loading')
-try {
- csmod = require(fs.pathJoin(modroot, 'csmodule'));
- casper.test.assertTrue(csmod.ok, 'require() patched version can load a coffeescript module');
-} catch (e) {
- casper.test.fail('require() patched version can load a coffeescript module');
-}
+casper.test.begin('CoffeeScript module loading', 1, function(test) {
+ var csmod;
+ try {
+ csmod = require(fs.pathJoin(modroot, 'csmodule'));
+ test.assertTrue(csmod.ok, 'require() patched version can load a coffeescript module');
+ } catch (e) {
+ test.fail('require() patched version can load a coffeescript module');
+ }
+ test.done();
+});
-casper.test.comment('JSON module loading')
-try {
- config = require(fs.pathJoin(modroot, 'config.json'));
- casper.test.assertTrue(config.ok, 'require() patched version can load a json module');
-} catch (e) {
- casper.test.fail('require() patched version can load a json module');
-}
-
-casper.test.done(3);
+casper.test.begin('JSON module loading', 1, function(test) {
+ var config;
+ try {
+ config = require(fs.pathJoin(modroot, 'config.json'));
+ test.assertTrue(config.ok, 'require() patched version can load a json module');
+ } catch (e) {
+ test.fail('require() patched version can load a json module');
+ }
+ test.done();
+});

0 comments on commit d4e2d54

Please sign in to comment.
Something went wrong with that request. Please try again.