first commit

This commit is contained in:
Sebastian McKenzie
2016-03-10 06:24:44 +00:00
parent f8e33840b0
commit 64ff4c3561
12 changed files with 168 additions and 30 deletions

View File

@@ -0,0 +1,97 @@
{
"type": "File",
"start": 0,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 8
}
},
"program": {
"type": "Program",
"start": 0,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 8
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 8
}
},
"expression": {
"type": "BinaryExpression",
"start": 0,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 7
}
},
"left": {
"type": "Identifier",
"start": 0,
"end": 1,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 1
}
},
"name": "a"
},
"operator": "<==",
"right": {
"type": "Identifier",
"start": 6,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 7
}
},
"name": "b"
}
}
}
],
"directives": []
}
}

View File

@@ -1,21 +1,20 @@
var getFixtures = require("babel-helper-fixtures").multiple;
var parse = require("../lib").parse;
var test = require("ava");
var _ = require("lodash");
var fixtures = getFixtures(__dirname + "/fixtures");
_.each(fixtures, function (suites, name) {
_.each(suites, function (testSuite) {
suite(name + "/" + testSuite.title, function () {
_.each(testSuite.tests, function (task) {
test(task.title, !task.disabled && function () {
try {
return runTest(task);
} catch (err) {
err.message = task.actual.loc + ": " + err.message;
throw err;
}
});
_.each(testSuite.tests, function (task) {
test(name + "/" + testSuite.title + "/" + task.title, !task.disabled && function () {
try {
return runTest(task);
} catch (err) {
err.message = task.actual.loc + ": " + err.message;
throw err;
}
});
});
});