Skip to content

Commit d375f63

Browse files
author
Christopher J. Brody
committed
cleanup: do not use defaults for normalized options
(and rename the internal function involved) Stryker Mutator shows 100% coverage in lib/lib.js with this update
1 parent a95ff72 commit d375f63

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lib/lib.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const { npmAddScriptSync } = require('./utils');
2222
const templates = require('../templates');
2323
const exampleTemplates = require('../templates/example');
2424

25-
const DEFAULT_PREFIX = '';
2625
const DEFAULT_PACKAGE_IDENTIFIER = 'com.reactlibrary';
2726
const DEFAULT_PLATFORMS = ['android', 'ios'];
2827
const DEFAULT_GITHUB_ACCOUNT = 'github_account';
@@ -47,14 +46,14 @@ const renderTemplateIfValid = (fs, root, template, templateArgs) => {
4746
);
4847
};
4948

50-
const generateWithOptions = ({
51-
name = 'unknown', // (should be normalized)
52-
prefix = DEFAULT_PREFIX,
53-
moduleName = 'unknown', // (should be normalized)
54-
className = 'unknown', // (should be normalized)
55-
modulePrefix = '', // (should be normalized)
49+
const generateWithNormalizedOptions = ({
50+
name,
51+
prefix,
52+
moduleName,
53+
className,
54+
modulePrefix,
5655
packageIdentifier = DEFAULT_PACKAGE_IDENTIFIER,
57-
namespace = 'unknown', // (should be normalized)
56+
namespace,
5857
platforms = DEFAULT_PLATFORMS,
5958
githubAccount = DEFAULT_GITHUB_ACCOUNT,
6059
authorName = DEFAULT_AUTHOR_NAME,
@@ -241,5 +240,7 @@ module.exports = function lib (options) {
241240
? arguments[1]
242241
: {};
243242

244-
return generateWithOptions(normalizedOptions(options), ioImports);
243+
return generateWithNormalizedOptions(
244+
normalizedOptions(options),
245+
ioImports);
245246
};

0 commit comments

Comments
 (0)