Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinr committed Jun 22, 2015
1 parent d6e48b8 commit e285712
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .settings/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
".git",
".tscache",
"bower_components",
"bin",
"bin",
"build",
"lib",
"lib",
"node_modules"
]
}
5 changes: 3 additions & 2 deletions test/formatters/externalFormatterTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
describe("External Formatter", () => {
var TEST_FILE = "formatters/externalFormatter.test.ts";
var TEST_MODULE = "../test/files/formatters/simple";
var sourceFile, formatter;
var sourceFile: ts.SourceFile, formatter: Lint.IFormatter;

before(function() {
var Formatter = Lint.Test.getFormatter(TEST_MODULE);
sourceFile = Lint.Test.getSourceFile(TEST_FILE);
formatter = new Formatter();
});

it("formats failures", () => {
var maxPosition = sourceFile.getFullWidth();

Expand Down Expand Up @@ -52,7 +53,7 @@ describe("External Formatter", () => {
assert.equal(result, "");
});

function getPositionString(line, character) {
function getPositionString(line: number, character: number) {
return "[" + line + ", " + character + "]";
}
});
5 changes: 2 additions & 3 deletions test/ruleDisableEnableTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("Enable and Disable Rules", () => {
var relativePath = path.join("test", "files", "rules/enabledisable.test.ts");
var source = fs.readFileSync(relativePath, "utf8");

var options = {
var options: Lint.ILinterOptions = {
formatter: "json",
configuration: validConfiguration,
rulesDirectory: null,
Expand All @@ -49,12 +49,11 @@ describe("Enable and Disable Rules", () => {
var expectedFailure5 = quotemarkFailure([10, 13], [10, 19]);
var expectedFailure6 = quotemarkFailure([16, 13], [16, 19]);


var ll = new Lint.Linter(relativePath, source, options);
var result = ll.lint();
var parsedResult = JSON.parse(result.output);
var actualFailures: Lint.RuleFailure[] = [];
parsedResult.forEach((failure) => {
parsedResult.forEach((failure: any) => {
var startArray = [failure.startPosition.line + 1, failure.startPosition.character + 1];
var endArray = [failure.endPosition.line + 1, failure.endPosition.character + 1];
actualFailures.push(Lint.Test.createFailure("rules/enabledisable.test.ts", startArray, endArray, failure.failure));
Expand Down
2 changes: 0 additions & 2 deletions test/rules/noVarKeywordRuleTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

/// <reference path='../references.ts' />

describe("<no-var-keyword>", () => {
it("disallows use of creating variables with 'var'", () => {
var fileName = "rules/novarkeyword.test.ts";
Expand Down
19 changes: 11 additions & 8 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
"noImplicitAny": true,
"sourceMap": false,
"target": "es5",
"out": "../build/tslint-tests.js"
"out": "build/tslint-tests.js"
},
"filesGlob": [
"../typings/*.d.ts",
"../lib/tslint.d.ts",
"./typings/*.ts",
"./**/*.ts",
"!./files/**/*"
"./references.ts",
"./helper.ts",
"./ruleDisableEnableTests.ts",
"./ruleLoaderTests.ts",
"./formatters/*.ts",
"./rules/*.ts"
],
"files": [
"../typings/node.d.ts",
Expand All @@ -21,16 +25,15 @@
"../lib/tslint.d.ts",
"./typings/chai.d.ts",
"./typings/mocha.d.ts",
"./chaiAssert.ts",
"./references.ts",
"./helper.ts",
"./ruleDisableEnableTests.ts",
"./ruleLoaderTests.ts",
"./formatters/externalFormatterTest.ts",
"./formatters/jsonFormatterTests.ts",
"./formatters/pmdFormatterTests.ts",
"./formatters/proseFormatterTests.ts",
"./formatters/verboseFormatterTests.ts",
"./helper.ts",
"./references.ts",
"./ruleDisableEnableTests.ts",
"./ruleLoaderTests.ts",
"./rules/alignRuleTests.ts",
"./rules/banRuleTests.ts",
"./rules/classNameRuleTests.ts",
Expand Down

0 comments on commit e285712

Please sign in to comment.