'use strict';

const debugFinder = require('./');
const assert = require('assert');
const File = require('vinyl');

describe('gulp-debug-finder', () => {
    it('should warn when there are debug statements present', (cb) => {
        const stream = debugFinder();

        stream.on('error', () => {
            assert(true);

            cb();
        });

        stream.write(new File({
            contents: new Buffer('if (true) { console.log("Hello world"); }'),
        }));

        stream.end();
    });
});

'use strict';

const debugFinder = require('./');
const assert = require('assert');
const File = require('vinyl');

describe('gulp-debug-finder', () => {
    it('should warn when there are debug statements present', (cb) => {
        const stream = debugFinder();

        stream.on('error', () => {
            assert(true);

            cb();
        });

        stream.write(new File({
            contents: new Buffer('if (true) { console.log("Hello world"); }'), // eslint-disable-line node/no-deprecated-api
        }));

        stream.end();
    });
});

Disable node/no-deprecated-api for Buffer constructor
Disable node/no-deprecated-api for Buffer constructor

The use is deprecated since Node 6 but we still support Node 4 so we can't replace it yet.
