Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
25 lines
788 B
JavaScript
25 lines
788 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
var fs = require('fs');
|
|
var path = require('path');
|
|
|
|
assert.equal(true, process.cwd() !== __dirname);
|
|
|
|
process.chdir(__dirname);
|
|
assert.equal(true, process.cwd() === __dirname);
|
|
|
|
var dir = path.resolve(common.fixturesDir,
|
|
'weird \uc3a4\uc3ab\uc3af characters \u00e1\u00e2\u00e3');
|
|
fs.mkdirSync(dir);
|
|
process.chdir(dir);
|
|
assert(process.cwd() == dir);
|
|
|
|
process.chdir('..');
|
|
assert(process.cwd() == path.resolve(common.fixturesDir));
|
|
fs.rmdirSync(dir);
|
|
|
|
assert.throws(function() { process.chdir({}); }, TypeError, 'Bad argument.');
|
|
assert.throws(function() { process.chdir(); }, TypeError, 'Bad argument.');
|
|
assert.throws(function() { process.chdir('x', 'y'); },
|
|
TypeError, 'Bad argument.');
|