Skip to content

Commit 2bbd78f

Browse files
Copilotmariuz
andcommitted
Fix service property tests: operator precedence bugs and missing database parameter
Co-authored-by: mariuz <18359+mariuz@users.noreply.github.com>
1 parent 2490419 commit 2bbd78f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/service.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ describe('Test Service', () => {
162162
it('should bring online', done => {
163163
testProperty(
164164
'BringOnline', [DATABASE.database],
165-
(data) => !data.indexOf('maintenance') > -1, done
165+
(data) => data.indexOf('maintenance') === -1, done
166166
)
167167
});
168168

@@ -183,7 +183,7 @@ describe('Test Service', () => {
183183
RegExp.prototype.test.bind(possibility.test), () => {
184184
testProperty(
185185
'BringOnline', [DATABASE.database],
186-
(data) => !data.indexOf('maintenance') > -1, done
186+
(data) => data.indexOf('maintenance') === -1, done
187187
);
188188
}
189189
);
@@ -216,7 +216,7 @@ describe('Test Service', () => {
216216
it('should enable reverse space', done => {
217217
testProperty(
218218
'setReservespace', [DATABASE.database, true],
219-
data => !data.indexOf('no reverse') > -1, done
219+
data => data.indexOf('no reserve') === -1, done
220220
);
221221
});
222222

@@ -246,11 +246,14 @@ describe('Test Service', () => {
246246
Firebird.attach(config, (err, srv) => {
247247
assert.ok(!err, err);
248248

249+
// Get the database path from args (it's the first argument for most property functions)
250+
const dbPath = args[0];
251+
249252
// Push callback into args
250253
args.push((err, data) => {
251254
assert.ok(!err, err);
252255

253-
srv.getStats({}, (err, data) => {
256+
srv.getStats({database: dbPath}, (err, data) => {
254257
assert.ok(!err, err);
255258

256259
readStream(data, result => {

0 commit comments

Comments
 (0)