Skip to content

Commit 0594780

Browse files
author
Christopher J. Brody
committed
test with custom prefix for Android & iOS
covers extra breaking mutation 2a from PR #84: diff --git a/lib/normalized-options.js b/lib/normalized-options.js index 9c49d88..773981d 100644 --- a/lib/normalized-options.js +++ b/lib/normalized-options.js @@ -8,7 +8,7 @@ const DEFAULT_MODULE_PREFIX = 'react-native'; module.exports = (options) => { const name = options.name; - const prefix = options.prefix || ''; + const prefix = ''; const modulePrefix = options.modulePrefix || DEFAULT_MODULE_PREFIX;
1 parent 7c9c377 commit 0594780

File tree

2 files changed

+44
-43
lines changed

2 files changed

+44
-43
lines changed

tests/with-injection/create/with-options/platforms-array/__snapshots__/platforms-array.test.js.snap

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Array [
3232
",
3333
"* ensureDir dir: react-native-alice-bobbi/ios/
3434
",
35-
"* ensureDir dir: react-native-alice-bobbi/ios/AliceBobbi.xcworkspace/
35+
"* ensureDir dir: react-native-alice-bobbi/ios/ABCAliceBobbi.xcworkspace/
3636
",
37-
"* ensureDir dir: react-native-alice-bobbi/ios/AliceBobbi.xcodeproj/
37+
"* ensureDir dir: react-native-alice-bobbi/ios/ABCAliceBobbi.xcodeproj/
3838
",
3939
"* outputFile name: react-native-alice-bobbi/README.md
4040
content:
@@ -55,15 +55,15 @@ content:
5555
#### iOS
5656
5757
1. In XCode, in the project navigator, right click \`Libraries\`\`Add Files to [your project's name]\`
58-
2. Go to \`node_modules\`\`react-native-alice-bobbi\` and add \`AliceBobbi.xcodeproj\`
59-
3. In XCode, in the project navigator, select your project. Add \`libAliceBobbi.a\` to your project's \`Build Phases\`\`Link Binary With Libraries\`
58+
2. Go to \`node_modules\`\`react-native-alice-bobbi\` and add \`ABCAliceBobbi.xcodeproj\`
59+
3. In XCode, in the project navigator, select your project. Add \`libABCAliceBobbi.a\` to your project's \`Build Phases\`\`Link Binary With Libraries\`
6060
4. Run your project (\`Cmd+R\`)<
6161
6262
#### Android
6363
6464
1. Open up \`android/app/src/main/java/[...]/MainApplication.java\`
65-
- Add \`import com.reactlibrary.AliceBobbiPackage;\` to the imports at the top of the file
66-
- Add \`new AliceBobbiPackage()\` to the list returned by the \`getPackages()\` method
65+
- Add \`import com.reactlibrary.ABCAliceBobbiPackage;\` to the imports at the top of the file
66+
- Add \`new ABCAliceBobbiPackage()\` to the list returned by the \`getPackages()\` method
6767
2. Append the following lines to \`android/settings.gradle\`:
6868
\`\`\`
6969
include ':react-native-alice-bobbi'
@@ -77,10 +77,10 @@ content:
7777
7878
## Usage
7979
\`\`\`javascript
80-
import AliceBobbi from 'react-native-alice-bobbi';
80+
import ABCAliceBobbi from 'react-native-alice-bobbi';
8181
8282
// TODO: What to do with the module?
83-
AliceBobbi;
83+
ABCAliceBobbi;
8484
\`\`\`
8585
8686
<<<<<<<< ======== >>>>>>>>
@@ -129,9 +129,9 @@ content:
129129
--------
130130
import { NativeModules } from 'react-native';
131131
132-
const { AliceBobbi } = NativeModules;
132+
const { ABCAliceBobbi } = NativeModules;
133133
134-
export default AliceBobbi;
134+
export default ABCAliceBobbi;
135135
136136
<<<<<<<< ======== >>>>>>>>
137137
",
@@ -339,7 +339,7 @@ content:
339339
340340
<<<<<<<< ======== >>>>>>>>
341341
",
342-
"* outputFile name: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/AliceBobbiModule.java
342+
"* outputFile name: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ABCAliceBobbiModule.java
343343
content:
344344
--------
345345
package com.reactlibrary;
@@ -349,18 +349,18 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
349349
import com.facebook.react.bridge.ReactMethod;
350350
import com.facebook.react.bridge.Callback;
351351
352-
public class AliceBobbiModule extends ReactContextBaseJavaModule {
352+
public class ABCAliceBobbiModule extends ReactContextBaseJavaModule {
353353
354354
private final ReactApplicationContext reactContext;
355355
356-
public AliceBobbiModule(ReactApplicationContext reactContext) {
356+
public ABCAliceBobbiModule(ReactApplicationContext reactContext) {
357357
super(reactContext);
358358
this.reactContext = reactContext;
359359
}
360360
361361
@Override
362362
public String getName() {
363-
return \\"AliceBobbi\\";
363+
return \\"ABCAliceBobbi\\";
364364
}
365365
366366
@ReactMethod
@@ -372,7 +372,7 @@ public class AliceBobbiModule extends ReactContextBaseJavaModule {
372372
373373
<<<<<<<< ======== >>>>>>>>
374374
",
375-
"* outputFile name: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/AliceBobbiPackage.java
375+
"* outputFile name: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/ABCAliceBobbiPackage.java
376376
content:
377377
--------
378378
package com.reactlibrary;
@@ -387,10 +387,10 @@ import com.facebook.react.bridge.ReactApplicationContext;
387387
import com.facebook.react.uimanager.ViewManager;
388388
import com.facebook.react.bridge.JavaScriptModule;
389389
390-
public class AliceBobbiPackage implements ReactPackage {
390+
public class ABCAliceBobbiPackage implements ReactPackage {
391391
@Override
392392
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
393-
return Arrays.<NativeModule>asList(new AliceBobbiModule(reactContext));
393+
return Arrays.<NativeModule>asList(new ABCAliceBobbiModule(reactContext));
394394
}
395395
396396
@Override
@@ -453,24 +453,24 @@ end
453453
454454
<<<<<<<< ======== >>>>>>>>
455455
",
456-
"* outputFile name: react-native-alice-bobbi/ios/AliceBobbi.h
456+
"* outputFile name: react-native-alice-bobbi/ios/ABCAliceBobbi.h
457457
content:
458458
--------
459459
#import <React/RCTBridgeModule.h>
460460
461-
@interface AliceBobbi : NSObject <RCTBridgeModule>
461+
@interface ABCAliceBobbi : NSObject <RCTBridgeModule>
462462
463463
@end
464464
465465
<<<<<<<< ======== >>>>>>>>
466466
",
467-
"* outputFile name: react-native-alice-bobbi/ios/AliceBobbi.m
467+
"* outputFile name: react-native-alice-bobbi/ios/ABCAliceBobbi.m
468468
content:
469469
--------
470-
#import \\"AliceBobbi.h\\"
470+
#import \\"ABCAliceBobbi.h\\"
471471
472472
473-
@implementation AliceBobbi
473+
@implementation ABCAliceBobbi
474474
475475
RCT_EXPORT_MODULE()
476476
@@ -484,20 +484,20 @@ RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnu
484484
485485
<<<<<<<< ======== >>>>>>>>
486486
",
487-
"* outputFile name: react-native-alice-bobbi/ios/AliceBobbi.xcworkspace/contents.xcworkspacedata
487+
"* outputFile name: react-native-alice-bobbi/ios/ABCAliceBobbi.xcworkspace/contents.xcworkspacedata
488488
content:
489489
--------
490490
<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?>
491491
<Workspace
492492
version = \\"1.0\\">
493493
<FileRef
494-
location = \\"group:AliceBobbi.xcodeproj\\">
494+
location = \\"group:ABCAliceBobbi.xcodeproj\\">
495495
</FileRef>
496496
</Workspace>
497497
498498
<<<<<<<< ======== >>>>>>>>
499499
",
500-
"* outputFile name: react-native-alice-bobbi/ios/AliceBobbi.xcodeproj/project.pbxproj
500+
"* outputFile name: react-native-alice-bobbi/ios/ABCAliceBobbi.xcodeproj/project.pbxproj
501501
content:
502502
--------
503503
// !$*UTF8*$!
@@ -509,7 +509,7 @@ content:
509509
objects = {
510510
511511
/* Begin PBXBuildFile section */
512-
B3E7B58A1CC2AC0600A0062D /* AliceBobbi.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* AliceBobbi.m */; };
512+
B3E7B58A1CC2AC0600A0062D /* ABCAliceBobbi.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* ABCAliceBobbi.m */; };
513513
/* End PBXBuildFile section */
514514
515515
/* Begin PBXCopyFilesBuildPhase section */
@@ -525,9 +525,9 @@ content:
525525
/* End PBXCopyFilesBuildPhase section */
526526
527527
/* Begin PBXFileReference section */
528-
134814201AA4EA6300B7C361 /* libAliceBobbi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAliceBobbi.a; sourceTree = BUILT_PRODUCTS_DIR; };
529-
B3E7B5881CC2AC0600A0062D /* AliceBobbi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliceBobbi.h; sourceTree = \\"<group>\\"; };
530-
B3E7B5891CC2AC0600A0062D /* AliceBobbi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliceBobbi.m; sourceTree = \\"<group>\\"; };
528+
134814201AA4EA6300B7C361 /* libABCAliceBobbi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libABCAliceBobbi.a; sourceTree = BUILT_PRODUCTS_DIR; };
529+
B3E7B5881CC2AC0600A0062D /* ABCAliceBobbi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABCAliceBobbi.h; sourceTree = \\"<group>\\"; };
530+
B3E7B5891CC2AC0600A0062D /* ABCAliceBobbi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ABCAliceBobbi.m; sourceTree = \\"<group>\\"; };
531531
/* End PBXFileReference section */
532532
533533
/* Begin PBXFrameworksBuildPhase section */
@@ -544,26 +544,26 @@ content:
544544
134814211AA4EA7D00B7C361 /* Products */ = {
545545
isa = PBXGroup;
546546
children = (
547-
134814201AA4EA6300B7C361 /* libAliceBobbi.a */,
547+
134814201AA4EA6300B7C361 /* libABCAliceBobbi.a */,
548548
);
549549
name = Products;
550550
sourceTree = \\"<group>\\";
551551
};
552552
58B511D21A9E6C8500147676 = {
553553
isa = PBXGroup;
554554
children = (
555-
B3E7B5881CC2AC0600A0062D /* AliceBobbi.h */,
556-
B3E7B5891CC2AC0600A0062D /* AliceBobbi.m */,
555+
B3E7B5881CC2AC0600A0062D /* ABCAliceBobbi.h */,
556+
B3E7B5891CC2AC0600A0062D /* ABCAliceBobbi.m */,
557557
134814211AA4EA7D00B7C361 /* Products */,
558558
);
559559
sourceTree = \\"<group>\\";
560560
};
561561
/* End PBXGroup section */
562562
563563
/* Begin PBXNativeTarget section */
564-
58B511DA1A9E6C8500147676 /* AliceBobbi */ = {
564+
58B511DA1A9E6C8500147676 /* ABCAliceBobbi */ = {
565565
isa = PBXNativeTarget;
566-
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \\"AliceBobbi\\" */;
566+
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \\"ABCAliceBobbi\\" */;
567567
buildPhases = (
568568
58B511D71A9E6C8500147676 /* Sources */,
569569
58B511D81A9E6C8500147676 /* Frameworks */,
@@ -573,9 +573,9 @@ content:
573573
);
574574
dependencies = (
575575
);
576-
name = AliceBobbi;
576+
name = ABCAliceBobbi;
577577
productName = RCTDataManager;
578-
productReference = 134814201AA4EA6300B7C361 /* libAliceBobbi.a */;
578+
productReference = 134814201AA4EA6300B7C361 /* libABCAliceBobbi.a */;
579579
productType = \\"com.apple.product-type.library.static\\";
580580
};
581581
/* End PBXNativeTarget section */
@@ -592,7 +592,7 @@ content:
592592
};
593593
};
594594
};
595-
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \\"AliceBobbi\\" */;
595+
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \\"ABCAliceBobbi\\" */;
596596
compatibilityVersion = \\"Xcode 3.2\\";
597597
developmentRegion = English;
598598
hasScannedForEncodings = 0;
@@ -604,7 +604,7 @@ content:
604604
projectDirPath = \\"\\";
605605
projectRoot = \\"\\";
606606
targets = (
607-
58B511DA1A9E6C8500147676 /* AliceBobbi */,
607+
58B511DA1A9E6C8500147676 /* ABCAliceBobbi */,
608608
);
609609
};
610610
/* End PBXProject section */
@@ -614,7 +614,7 @@ content:
614614
isa = PBXSourcesBuildPhase;
615615
buildActionMask = 2147483647;
616616
files = (
617-
B3E7B58A1CC2AC0600A0062D /* AliceBobbi.m in Sources */,
617+
B3E7B58A1CC2AC0600A0062D /* ABCAliceBobbi.m in Sources */,
618618
);
619619
runOnlyForDeploymentPostprocessing = 0;
620620
};
@@ -725,7 +725,7 @@ content:
725725
);
726726
LIBRARY_SEARCH_PATHS = \\"$(inherited)\\";
727727
OTHER_LDFLAGS = \\"-ObjC\\";
728-
PRODUCT_NAME = AliceBobbi;
728+
PRODUCT_NAME = ABCAliceBobbi;
729729
SKIP_INSTALL = YES;
730730
};
731731
name = Debug;
@@ -741,15 +741,15 @@ content:
741741
);
742742
LIBRARY_SEARCH_PATHS = \\"$(inherited)\\";
743743
OTHER_LDFLAGS = \\"-ObjC\\";
744-
PRODUCT_NAME = AliceBobbi;
744+
PRODUCT_NAME = ABCAliceBobbi;
745745
SKIP_INSTALL = YES;
746746
};
747747
name = Release;
748748
};
749749
/* End XCBuildConfiguration section */
750750
751751
/* Begin XCConfigurationList section */
752-
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \\"AliceBobbi\\" */ = {
752+
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \\"ABCAliceBobbi\\" */ = {
753753
isa = XCConfigurationList;
754754
buildConfigurations = (
755755
58B511ED1A9E6C8500147676 /* Debug */,
@@ -758,7 +758,7 @@ content:
758758
defaultConfigurationIsVisible = 0;
759759
defaultConfigurationName = Release;
760760
};
761-
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \\"AliceBobbi\\" */ = {
761+
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \\"ABCAliceBobbi\\" */ = {
762762
isa = XCConfigurationList;
763763
buildConfigurations = (
764764
58B511F01A9E6C8500147676 /* Debug */,

tests/with-injection/create/with-options/platforms-array/platforms-array.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ test('create alice-bobbi module with config options for android,ios comma separa
1010
const options = {
1111
platforms: ['android', 'ios'],
1212
name: 'alice-bobbi',
13+
prefix: 'ABC',
1314
githubAccount: 'alicebits',
1415
authorName: 'Alice',
1516
authorEmail: '[email protected]',

0 commit comments

Comments
 (0)