mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-29 18:12:48 +03:00
ab6c6d959d
- Δημιουργία script για παραγωγή documention του κώδικα - Μικρές διορθώσεις
35 lines
No EOL
958 B
JavaScript
35 lines
No EOL
958 B
JavaScript
/*global describe: true, expect: true, it: true */
|
|
describe("path", function() {
|
|
// TODO: more tests
|
|
var path = require('path');
|
|
|
|
var pathChunks = [
|
|
"foo",
|
|
"bar",
|
|
"baz",
|
|
"qux.html"
|
|
];
|
|
var joinedPath = path.join.apply(this, pathChunks);
|
|
|
|
describe("basename", function() {
|
|
it("should exist", function() {
|
|
expect(path.basename).toBeDefined();
|
|
});
|
|
|
|
it("should be a function", function() {
|
|
expect(typeof path.basename).toEqual("function");
|
|
});
|
|
|
|
it("should work correctly without an 'ext' parameter", function() {
|
|
expect( path.basename(joinedPath) ).toEqual( pathChunks[pathChunks.length - 1] );
|
|
});
|
|
|
|
it("should work correctly with an 'ext' parameter", function() {
|
|
var fn = pathChunks[pathChunks.length - 1],
|
|
ext = Array.prototype.slice.call( fn, fn.indexOf(".") ).join("");
|
|
bn = Array.prototype.slice.call( fn, 0, fn.indexOf(".") ).join("");
|
|
|
|
expect( path.basename(joinedPath, ext) ).toEqual(bn);
|
|
});
|
|
});
|
|
}); |