Skip to content

Commit

Permalink
Merge pull request #18 from smikes/manual-merge
Browse files Browse the repository at this point in the history
Manual merge
  • Loading branch information
smikes authored Mar 14, 2019
2 parents 703a5aa + ed066fa commit bbcddc9
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 39 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "test262-parser",
"version": "2.0.7",
"version": "2.0.10",
"description": "Parse a test262-format test and provide API",
"main": "lib/parser.js",
"scripts": {
Expand All @@ -23,7 +23,8 @@
],
"author": "Brian Terlson",
"contributors": [
"Sam Mikes"
"Sam Mikes",
"Adrian Heine"
],
"license": "MSFT MIT-like",
"directories": [
Expand Down
74 changes: 37 additions & 37 deletions test/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ describe('works on non-formatted files', function () {
});

it('does not fail if no newline at end of file', function () {
var file = parser.parseFile(fixtures.no_newline);
parser.parseFile(fixtures.no_newline);
});
});

Expand All @@ -145,7 +145,7 @@ describe('works with test content preceeding the frontmatter', function () {
});
});

describe('reports valid test262 file', function() {
describe('reports valid test262 file', function () {
it('in S72', function () {
var file = parser.parseFile(fixtures.S72);
assert(file.isATest);
Expand All @@ -163,44 +163,44 @@ describe('reports valid test262 file', function() {
});

describe('reports non-test262 file', function () {
it('detects a non-test262 file', function () {
var file = parser.parseFile(fixtures.issue_9);
it('detects a non-test262 file', function () {
var file = parser.parseFile(fixtures.issue_9);

assert(!file.isATest)
});
assert(!file.isATest);
});
});

describe('has a stream interface', function () {
// should be last test: ends stream (not repeatable)
it('provides a stream interface', function (done) {
var counts = {
processed: 0,
error: 0
};

parser.on('data', function (f) {
assert.equal(f.file, 'S72');
assert.equal(f.attrs.es5id, '7.2_A1.1_T1');
counts.processed += 1;
// should be last test: ends stream (not repeatable)
it('provides a stream interface', function (done) {
var counts = {
processed: 0,
error: 0
};

parser.on('data', function (f) {
assert.equal(f.file, 'S72');
assert.equal(f.attrs.es5id, '7.2_A1.1_T1');
counts.processed += 1;
});
parser.on('error', function (e) {
assert.ok(/YAML/.test(e));
counts.error += 1;
});
parser.on('end', function () {
assert.equal(counts.processed, 1);
assert.equal(counts.error, 1);
done();
});

parser.write({
file: 'S72',
contents: fixtures.S72
});
parser.write({
file: 'badYAML.js',
contents: fixtures.badYAML
});
parser.end();
});
parser.on('error', function (e) {
assert.ok(/YAML/.test(e));
counts.error += 1;
});
parser.on('end', function () {
assert.equal(counts.processed, 1);
assert.equal(counts.error, 1);
done();
});

parser.write({
file: 'S72',
contents: fixtures.S72
});
parser.write({
file: 'badYAML.js',
contents: fixtures.badYAML
});
parser.end();
});
});

0 comments on commit bbcddc9

Please sign in to comment.