Skip to content

Commit

Permalink
test: Fix mocha/no-hooks-for-single-case eslint issue (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
abmusse committed Dec 8, 2020
1 parent 8bb5860 commit cb5d077
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 34 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ module.exports = {

// The following rules cause problems for our existing tests, so they are disabled for now:
'mocha/no-skipped-tests': 'off',
'mocha/no-hooks-for-single-case': 'off',
},
},
],
Expand Down
27 changes: 12 additions & 15 deletions test/functional/deprecated/iWorkFunctional.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,25 +210,22 @@ describe('iWork Functional Tests', function () {
});

describe('getDataArea', function () {
before('init lib, data area, and add data', function (done) {
it('returns contents of a data area', function (done) {
checkObjectExists(config, 'TESTDA', '*DTAARA', (error) => {
if (error) { throw error; }
done();
});
});
it('returns contents of a data area', function (done) {
const connection = new iConn(database, username, password, restOptions);
const connection = new iConn(database, username, password, restOptions);

const work = new iWork(connection);
const work = new iWork(connection);

work.getDataArea('NODETKTEST', 'TESTDA', 20, (output) => {
expect(output).to.be.an('Object');
expect(output).to.have.a.property('Type_of_value_returned');
expect(output).to.have.a.property('Library_name');
expect(output).to.have.a.property('Length_of_value_returned');
expect(output).to.have.a.property('Number_of_decimal_positions');
expect(output).to.have.a.property('Value');
done();
work.getDataArea('NODETKTEST', 'TESTDA', 20, (output) => {
expect(output).to.be.an('Object');
expect(output).to.have.a.property('Type_of_value_returned');
expect(output).to.have.a.property('Library_name');
expect(output).to.have.a.property('Length_of_value_returned');
expect(output).to.have.a.property('Number_of_decimal_positions');
expect(output).to.have.a.property('Value');
done();
});
});
});
});
Expand Down
33 changes: 15 additions & 18 deletions test/functional/iWorkFunctional.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,26 +192,23 @@ describe('iWork Functional Tests', function () {
});

describe('getDataArea', function () {
before('check if data area exists for tests', function (done) {
it('returns contents of a data area', function (done) {
checkObjectExists(config, 'TESTDA', '*DTAARA', (error) => {
if (error) { throw error; }
done();
});
});
it('returns contents of a data area', function (done) {
const connection = new Connection(config);

const work = new iWork(connection);

work.getDataArea('NODETKTEST', 'TESTDA', 20, (error, output) => {
expect(error).to.equal(null);
expect(output).to.be.an('Object');
expect(output).to.have.a.property('Type_of_value_returned');
expect(output).to.have.a.property('Library_name');
expect(output).to.have.a.property('Length_of_value_returned');
expect(output).to.have.a.property('Number_of_decimal_positions');
expect(output).to.have.a.property('Value');
done();
const connection = new Connection(config);

const work = new iWork(connection);

work.getDataArea('NODETKTEST', 'TESTDA', 20, (error2, output) => {
expect(error2).to.equal(null);
expect(output).to.be.an('Object');
expect(output).to.have.a.property('Type_of_value_returned');
expect(output).to.have.a.property('Library_name');
expect(output).to.have.a.property('Length_of_value_returned');
expect(output).to.have.a.property('Number_of_decimal_positions');
expect(output).to.have.a.property('Value');
done();
});
});
});
});
Expand Down

0 comments on commit cb5d077

Please sign in to comment.