Skip to content

Commit

Permalink
Remove Sinon dev dependency (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankie567 authored and SimenB committed Sep 17, 2018
1 parent 00f1b79 commit 7fd5477
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 114 deletions.
1 change: 1 addition & 0 deletions lib/metrics/processOpenFileDescriptors.js
Expand Up @@ -2,6 +2,7 @@

const Gauge = require('../gauge');
const fs = require('fs');
const process = require('process');

const PROCESS_OPEN_FDS = 'process_open_fds';

Expand Down
109 changes: 0 additions & 109 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -31,7 +31,6 @@
"lint-staged": "^7.0.0",
"lolex": "^2.1.3",
"prettier": "1.11.1",
"sinon": "^6.0.1",
"typescript": "^2.5.2"
},
"dependencies": {
Expand Down
9 changes: 5 additions & 4 deletions test/metrics/processOpenFileDescriptorsTest.js
@@ -1,20 +1,21 @@
'use strict';

describe('processOpenFileDescriptors', () => {
const sinon = require('sinon');
const register = require('../../index').register;
const processOpenFileDescriptors = require('../../lib/metrics/processOpenFileDescriptors');

const sinonSandbox = sinon.createSandbox();
jest.mock(
'process',
() =>
Object.assign({}, jest.requireActual('process'), { platform: 'linux' }) // This metric only works on Linux
);

beforeAll(() => {
sinonSandbox.stub(process, 'platform').value('linux'); // This metric only works on Linux
register.clear();
});

afterEach(() => {
register.clear();
sinonSandbox.restore();
});

it('should add metric to the registry', () => {
Expand Down

0 comments on commit 7fd5477

Please sign in to comment.