diff --git a/index.js b/index.js index 2a3f6e5..82984ca 100644 --- a/index.js +++ b/index.js @@ -1,11 +1,11 @@ 'use strict'; if (process.platform === 'darwin') { - module.exports = require('./platform/darwin'); + module.exports = require('./lib/darwin'); } else if (process.platform === 'linux') { - module.exports = require('./platform/linux'); + module.exports = require('./lib/linux'); } else if (process.platform === 'win32') { - module.exports = require('./platform/win32'); + module.exports = require('./lib/win32'); } else { throw new Error('Only linux, darwin and win32 are supported, you have: ' + process.platform); } diff --git a/package.json b/package.json index 11281d1..084af80 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "lint": "eslint .", "pretest": "npm run lint", - "test": "mocha './tests/*.spec.js'", + "test": "mocha './test/*.spec.js'", "test:watch": "npm test -- -w -b" }, "repository": { @@ -42,6 +42,6 @@ ], "files": [ "index.js", - "./platform/*.js" + "./lib/*.js" ] } diff --git a/test/darwin.spec.js b/test/darwin.spec.js index 1c49cbf..8715953 100644 --- a/test/darwin.spec.js +++ b/test/darwin.spec.js @@ -4,7 +4,7 @@ const assert = require('assert'); describe('darwin', () => { it('should parse the date', () => { - let darwin = proxyquire('../platform/darwin', { + let darwin = proxyquire('../lib/darwin', { 'child_process': { execSync: (cmd) => { assert.equal(cmd, 'sysctl -n kern.boottime', 'should call sysctl command'); diff --git a/test/index.spec.js b/test/index.spec.js index c78c3b2..cbd0ed8 100644 --- a/test/index.spec.js +++ b/test/index.spec.js @@ -17,13 +17,13 @@ describe('index', function () { it('should require darwin', function () { let uptime = proxyquire('../index', { - './platform/darwin': { + './lib/darwin': { type: 'darwin' }, - './platform/linux': { + './lib/linux': { type: 'linux' }, - './platform/win32': { + './lib/win32': { type: 'win32' } }); @@ -42,10 +42,10 @@ describe('index', function () { './plaform/darwin': { type: 'darwin' }, - './platform/linux': { + './lib/linux': { type: 'linux' }, - './platform/win32': { + './lib/win32': { type: 'win32' } }); @@ -61,13 +61,13 @@ describe('index', function () { it('should require win32', function () { let uptime = proxyquire('../index', { - './plaform/darwin': { + './lib/darwin': { type: 'darwin' }, - './platform/linux': { + './lib/linux': { type: 'linux' }, - './platform/win32': { + './lib/win32': { type: 'win32' } }); diff --git a/test/linux.spec.js b/test/linux.spec.js index 919e101..f201737 100644 --- a/test/linux.spec.js +++ b/test/linux.spec.js @@ -4,7 +4,7 @@ const assert = require('assert'); describe('linux', () => { it('should parse the date', () => { - let linux = proxyquire('../platform/linux', { + let linux = proxyquire('../lib/linux', { 'child_process': { execSync: (cmd) => { assert.equal(cmd, 'uptime -s', 'should call uptime command'); diff --git a/test/win32.spec.js b/test/win32.spec.js index 590cee4..fcc34fa 100644 --- a/test/win32.spec.js +++ b/test/win32.spec.js @@ -4,7 +4,7 @@ const assert = require('assert'); describe('win32', () => { it('should parse the date', () => { - let win32 = proxyquire('../platform/win32', { + let win32 = proxyquire('../lib/win32', { 'child_process': { execSync: (cmd) => { assert.equal(cmd, 'net statistics workstation', 'should call net statistics workstation command');