'use strict';

/* global describe, it, before, beforeEach, after, afterEach */

const assert = require('assert');
const sinon = require('sinon');
const Autolabel = require('../src/autolabel');
const mockery = require('mockery');
var autolabel, watch, path, fs, util, nt, escRegex, utorrent;

before(() => {
    mockery.enable({
        warnOnReplace: false,
        warnOnUnregistered: false
    });
});

after(() => {
    mockery.disable();
});

beforeEach(() => {
    global.config = {get: sinon.stub(), set: sinon.spy()};
    watch = {};
    utorrent = {};
    mockery.registerMock('utorrent-api', sinon.stub().returns(utorrent));
    mockery.registerMock('watch', watch);
    autolabel = new Autolabel(false);
});

describe('start', () => {
    it('should start monitoring the directory', () => {
        watch.createMonitor = sinon.spy();
        global.config.get.returns('test');

        autolabel.start();

        assert.equal(watch.createMonitor.getCall(0).args[0], 'test');
    });
});
@@ -282,16 +282,24 @@
 utorrent
+, notify
 ;%0A%0Abefor
@@ -542,29 +542,73 @@
 h = 
-%7B%7D;%0A    utorrent = %7B%7D
+utorrent = notify = %7B%7D;%0A    utorrent.setCredentials = sinon.spy()
 ;%0A  
@@ -679,16 +679,16 @@
 rent));%0A
-
     mock
@@ -721,16 +721,67 @@
 watch);%0A
+    mockery.registerMock('libnotify-ffi', notify);%0A
     auto

fix new autolabel testing CI