Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
53863ca3
...
53863ca3ab20423ed5381777a14e3c37daa46453
authored
2012-12-28 12:30:24 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
migrated fs tests to new testing format
1 parent
6611bc21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
tests/suites/fs.js
tests/suites/fs.js
View file @
53863ca
/*global casper*/
/*jshint strict:false*/
var
fs
=
require
(
'fs'
)
,
t
=
casper
.
test
;
var
fs
=
require
(
'fs'
);
// Testing added methods
(
function
()
{
t
.
comment
(
'fs.dirname()'
);
casper
.
test
.
begin
(
'fs.dirname() tests'
,
8
,
function
(
test
)
{
var
tests
=
{
'/local/plop/foo.js'
:
'/local/plop'
,
'local/plop/foo.js'
:
'local/plop'
,
...
...
@@ -16,12 +14,12 @@ var fs = require('fs'), t = casper.test;
'c:'
:
'c:'
};
for
(
var
testCase
in
tests
)
{
t
.
assertEquals
(
fs
.
dirname
(
testCase
),
tests
[
testCase
],
'fs.dirname() does its job for '
+
testCase
);
t
est
.
assertEquals
(
fs
.
dirname
(
testCase
),
tests
[
testCase
],
'fs.dirname() does its job for '
+
testCase
);
}
})();
test
.
done
();
});
(
function
()
{
t
.
comment
(
'fs.dirname()'
);
casper
.
test
.
begin
(
'fs.isWindows() tests'
,
6
,
function
(
test
)
{
var
tests
=
{
'/'
:
false
,
'/local/plop/foo.js'
:
false
,
...
...
@@ -31,8 +29,7 @@ var fs = require('fs'), t = casper.test;
'\\\\Server\\Plop'
:
true
};
for
(
var
testCase
in
tests
)
{
t
.
assertEquals
(
fs
.
isWindows
(
testCase
),
tests
[
testCase
],
'fs.isWindows() does its job for '
+
testCase
);
t
est
.
assertEquals
(
fs
.
isWindows
(
testCase
),
tests
[
testCase
],
'fs.isWindows() does its job for '
+
testCase
);
}
})();
t
.
done
(
14
);
test
.
done
();
});
...
...
Please
register
or
sign in
to post a comment