From 09871841eb4cce21ce0b614c1cecf88815c32545 Mon Sep 17 00:00:00 2001 From: Steven Edouard Date: Thu, 12 Nov 2015 09:56:32 -0800 Subject: [PATCH] fix(test) - require index.js for best test coverage --- index.js | 3 +-- test/file_association.js | 2 +- test/key.js | 4 ++-- test/registry.js | 11 +++-------- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index 3ac5436..ae590d1 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,5 @@ module.exports = { types: require('./lib/types'), windef: require('./lib/windef'), Key: require('./lib/key'), - fileAssociation: require('./lib/file_association'), - uac: require('./lib/uac') + utils: require('./lib/utils') }; \ No newline at end of file diff --git a/test/file_association.js b/test/file_association.js index 878f553..8083ee4 100644 --- a/test/file_association.js +++ b/test/file_association.js @@ -4,7 +4,7 @@ if (process.env.TEST_MOCKS_ON) { require('./test_helper'); } -var utils = require('../lib/utils'), +var utils = require('../index').utils, assert = require('assert'); describe('File Association Test', () => { diff --git a/test/key.js b/test/key.js index 57ed268..122141c 100644 --- a/test/key.js +++ b/test/key.js @@ -2,8 +2,8 @@ 'use strict'; require('./test_helper'); var assert = require('assert'), - windef = require('../lib/windef'), - Key = require('../lib/key'); + windef = require('../index').windef, + Key = require('../index').Key; describe('Key Open Tests', () => { it('Should create a key given a subkey', () => { diff --git a/test/registry.js b/test/registry.js index 5595eb4..13ad47a 100644 --- a/test/registry.js +++ b/test/registry.js @@ -2,12 +2,11 @@ 'use strict'; require('./test_helper'); -var assert = require('assert'); +var assert = require('assert'), + registry = require('../index').registry, + windef = require('../index').windef; describe('Registry API open tests', () => { - var registry = require('../lib/registry'), - windef = require('../lib/windef'); - it('Should open a subkey provided a predefined key', () => { var key = registry.openKeyFromPredefined(windef.HKEY.HKEY_CLASSES_ROOT, '.txt', windef.KEY_ACCESS.KEY_ALL_ACCESS); console.log(key.handle); @@ -23,8 +22,6 @@ describe('Registry API open tests', () => { }); describe('Create Key Tests', function () { - var registry = require('../lib/registry'), - windef = require('../lib/windef'); it('Should create a new key and delete it', () => { var key = registry.openKeyFromPredefined(windef.HKEY.HKEY_CLASSES_ROOT, '.txt', windef.KEY_ACCESS.KEY_ALL_ACCESS); @@ -52,8 +49,6 @@ describe('Create Key Tests', function () { }); describe('Set / Query Value Tests', function () { - var registry = require('../lib/registry'), - windef = require('../lib/windef'); it('Should set and read REG_SZ Value', () => { var key = registry.openKeyFromPredefined(windef.HKEY.HKEY_CLASSES_ROOT, '.txt', windef.KEY_ACCESS.KEY_ALL_ACCESS);