Skip to content

Commit cb5d077

Browse files
authored
test: Fix mocha/no-hooks-for-single-case eslint issue (#297)
1 parent 8bb5860 commit cb5d077

File tree

3 files changed

+27
-34
lines changed

3 files changed

+27
-34
lines changed

.eslintrc.js

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ module.exports = {
3131

3232
// The following rules cause problems for our existing tests, so they are disabled for now:
3333
'mocha/no-skipped-tests': 'off',
34-
'mocha/no-hooks-for-single-case': 'off',
3534
},
3635
},
3736
],

test/functional/deprecated/iWorkFunctional.js

+12-15
Original file line numberDiff line numberDiff line change
@@ -210,25 +210,22 @@ describe('iWork Functional Tests', function () {
210210
});
211211

212212
describe('getDataArea', function () {
213-
before('init lib, data area, and add data', function (done) {
213+
it('returns contents of a data area', function (done) {
214214
checkObjectExists(config, 'TESTDA', '*DTAARA', (error) => {
215215
if (error) { throw error; }
216-
done();
217-
});
218-
});
219-
it('returns contents of a data area', function (done) {
220-
const connection = new iConn(database, username, password, restOptions);
216+
const connection = new iConn(database, username, password, restOptions);
221217

222-
const work = new iWork(connection);
218+
const work = new iWork(connection);
223219

224-
work.getDataArea('NODETKTEST', 'TESTDA', 20, (output) => {
225-
expect(output).to.be.an('Object');
226-
expect(output).to.have.a.property('Type_of_value_returned');
227-
expect(output).to.have.a.property('Library_name');
228-
expect(output).to.have.a.property('Length_of_value_returned');
229-
expect(output).to.have.a.property('Number_of_decimal_positions');
230-
expect(output).to.have.a.property('Value');
231-
done();
220+
work.getDataArea('NODETKTEST', 'TESTDA', 20, (output) => {
221+
expect(output).to.be.an('Object');
222+
expect(output).to.have.a.property('Type_of_value_returned');
223+
expect(output).to.have.a.property('Library_name');
224+
expect(output).to.have.a.property('Length_of_value_returned');
225+
expect(output).to.have.a.property('Number_of_decimal_positions');
226+
expect(output).to.have.a.property('Value');
227+
done();
228+
});
232229
});
233230
});
234231
});

test/functional/iWorkFunctional.js

+15-18
Original file line numberDiff line numberDiff line change
@@ -192,26 +192,23 @@ describe('iWork Functional Tests', function () {
192192
});
193193

194194
describe('getDataArea', function () {
195-
before('check if data area exists for tests', function (done) {
195+
it('returns contents of a data area', function (done) {
196196
checkObjectExists(config, 'TESTDA', '*DTAARA', (error) => {
197197
if (error) { throw error; }
198-
done();
199-
});
200-
});
201-
it('returns contents of a data area', function (done) {
202-
const connection = new Connection(config);
203-
204-
const work = new iWork(connection);
205-
206-
work.getDataArea('NODETKTEST', 'TESTDA', 20, (error, output) => {
207-
expect(error).to.equal(null);
208-
expect(output).to.be.an('Object');
209-
expect(output).to.have.a.property('Type_of_value_returned');
210-
expect(output).to.have.a.property('Library_name');
211-
expect(output).to.have.a.property('Length_of_value_returned');
212-
expect(output).to.have.a.property('Number_of_decimal_positions');
213-
expect(output).to.have.a.property('Value');
214-
done();
198+
const connection = new Connection(config);
199+
200+
const work = new iWork(connection);
201+
202+
work.getDataArea('NODETKTEST', 'TESTDA', 20, (error2, output) => {
203+
expect(error2).to.equal(null);
204+
expect(output).to.be.an('Object');
205+
expect(output).to.have.a.property('Type_of_value_returned');
206+
expect(output).to.have.a.property('Library_name');
207+
expect(output).to.have.a.property('Length_of_value_returned');
208+
expect(output).to.have.a.property('Number_of_decimal_positions');
209+
expect(output).to.have.a.property('Value');
210+
done();
211+
});
215212
});
216213
});
217214
});

0 commit comments

Comments
 (0)