Skip to content

Commit d75c67b

Browse files
committed
test: cleanup unused variables & formatting
1 parent 81b2597 commit d75c67b

13 files changed

+56
-59
lines changed

test/addFramework.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('addFramework', () => {
7575
});
7676

7777
it('should populate the PBXFileReference section with 2 fields', () => {
78-
var newFile = proj.addFramework('libsqlite3.dylib');
78+
var newFile = proj.addFramework('libsqlite3.dylib'),
7979
fileRefSection = proj.pbxFileReferenceSection(),
8080
frsLength = Object.keys(fileRefSection).length;
8181

@@ -86,7 +86,7 @@ describe('addFramework', () => {
8686
});
8787

8888
it('should populate the PBXFileReference comment correctly', () => {
89-
var newFile = proj.addFramework('libsqlite3.dylib');
89+
var newFile = proj.addFramework('libsqlite3.dylib'),
9090
fileRefSection = proj.pbxFileReferenceSection(),
9191
commentKey = newFile.fileRef + '_comment';
9292

@@ -150,9 +150,9 @@ describe('addFramework', () => {
150150
});
151151

152152
it('should add to the Frameworks PBXGroup', () => {
153-
var newLength = proj.pbxGroupByName('Frameworks').children.length + 1,
154-
newFile = proj.addFramework('libsqlite3.dylib'),
155-
frameworks = proj.pbxGroupByName('Frameworks');
153+
var newLength = proj.pbxGroupByName('Frameworks').children.length + 1;
154+
proj.addFramework('libsqlite3.dylib');
155+
var frameworks = proj.pbxGroupByName('Frameworks');
156156

157157
assert.equal(frameworks.children.length, newLength);
158158
});
@@ -167,15 +167,14 @@ describe('addFramework', () => {
167167
});
168168

169169
it('should add to the PBXFrameworksBuildPhase', () => {
170-
var newFile = proj.addFramework('libsqlite3.dylib'),
171-
frameworks = proj.pbxFrameworksBuildPhaseObj();
172-
170+
proj.addFramework('libsqlite3.dylib');
171+
var frameworks = proj.pbxFrameworksBuildPhaseObj();
173172
assert.equal(frameworks.files.length, 16);
174173
});
175174

176175
it('should not add to the PBXFrameworksBuildPhase', () => {
177-
var newFile = proj.addFramework('Private.framework', {link: false}),
178-
frameworks = proj.pbxFrameworksBuildPhaseObj();
176+
proj.addFramework('Private.framework', {link: false});
177+
var frameworks = proj.pbxFrameworksBuildPhaseObj();
179178

180179
assert.equal(frameworks.files.length, 15);
181180
});
@@ -190,7 +189,7 @@ describe('addFramework', () => {
190189
});
191190

192191
it('should return false', () => {
193-
var newFile = proj.addFramework('libsqlite3.dylib');
192+
proj.addFramework('libsqlite3.dylib');
194193
assert.ok(!proj.addFramework('libsqlite3.dylib'));
195194
});
196195

@@ -219,19 +218,17 @@ describe('addFramework', () => {
219218
});
220219

221220
it('should add to the Embed Frameworks PBXCopyFilesBuildPhase', () => {
222-
var newFile = proj.addFramework('/path/to/SomeEmbeddableCustom.framework', {customFramework: true, embed: true}),
223-
frameworks = proj.pbxEmbedFrameworksBuildPhaseObj();
224-
221+
proj.addFramework('/path/to/SomeEmbeddableCustom.framework', {customFramework: true, embed: true});
222+
var frameworks = proj.pbxEmbedFrameworksBuildPhaseObj();
225223
var buildPhaseInPbx = proj.pbxEmbedFrameworksBuildPhaseObj();
226224
assert.equal(buildPhaseInPbx.dstSubfolderSpec, 10);
227225

228226
assert.equal(frameworks.files.length, 1);
229227
});
230228

231229
it('should not add to the Embed Frameworks PBXCopyFilesBuildPhase by default', () => {
232-
var newFile = proj.addFramework('/path/to/Custom.framework', {customFramework: true}),
233-
frameworks = proj.pbxEmbedFrameworksBuildPhaseObj();
234-
230+
proj.addFramework('/path/to/Custom.framework', {customFramework: true});
231+
var frameworks = proj.pbxEmbedFrameworksBuildPhaseObj();
235232
assert.equal(frameworks.files.length, 0);
236233
});
237234

test/addHeaderFile.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('addHeaderFile', () => {
7777
});
7878

7979
it('should add to the Plugins PBXGroup group', () => {
80-
var newFile = proj.addHeaderFile('Plugins/file.h'),
80+
proj.addHeaderFile('Plugins/file.h'),
8181
plugins = proj.pbxGroupByName('Plugins');
8282

8383
assert.equal(plugins.children.length, 1);
@@ -93,13 +93,14 @@ describe('addHeaderFile', () => {
9393
});
9494

9595
it('addHeaderFile duplicate entries: should return false', () => {
96-
var newFile = proj.addHeaderFile('Plugins/file.h');
96+
proj.addHeaderFile('Plugins/file.h');
9797
assert.ok(!proj.addHeaderFile('Plugins/file.h'));
9898
});
9999

100100
it('addHeaderFile duplicate entries: should not add another entry anywhere', () => {
101-
var newFile = proj.addHeaderFile('Plugins/file.h'),
102-
fileRefSection = proj.pbxFileReferenceSection(),
101+
proj.addHeaderFile('Plugins/file.h');
102+
103+
var fileRefSection = proj.pbxFileReferenceSection(),
103104
frsLength = Object.keys(fileRefSection).length,
104105
plugins = proj.pbxGroupByName('Plugins');
105106

test/addRemovePbxGroup.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('addRemovePbxGroup', () => {
5454

5555
it('should add the PBXGroup object correctly', () => {
5656
var pbxGroup = proj.addPbxGroup(['file.m'], 'MyGroup', 'Application', '"<group>"');
57-
pbxGroupInPbx = proj.pbxGroupByName('MyGroup');
57+
var pbxGroupInPbx = proj.pbxGroupByName('MyGroup');
5858

5959
assert.equal(pbxGroupInPbx.children, pbxGroup.pbxGroup.children);
6060
assert.equal(pbxGroupInPbx.isa, 'PBXGroup');
@@ -63,8 +63,9 @@ describe('addRemovePbxGroup', () => {
6363
});
6464

6565
it('should add <group> sourceTree if no other specified', () => {
66-
var pbxGroup = proj.addPbxGroup(['file.m'], 'MyGroup', 'Application');
67-
pbxGroupInPbx = proj.pbxGroupByName('MyGroup');
66+
proj.addPbxGroup(['file.m'], 'MyGroup', 'Application');
67+
68+
var pbxGroupInPbx = proj.pbxGroupByName('MyGroup');
6869

6970
assert.equal(pbxGroupInPbx.sourceTree, '"<group>"');
7071
});

test/addSourceFile.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ describe('addSourceFile', () => {
109109
});
110110

111111
it('should add to the Plugins PBXGroup group', () => {
112-
const newFile = proj.addSourceFile('Plugins/file.m');
112+
proj.addSourceFile('Plugins/file.m');
113+
113114
const plugins = proj.pbxGroupByName('Plugins');
114115
assert.strictEqual(plugins.children.length, 1);
115116
});
@@ -124,7 +125,8 @@ describe('addSourceFile', () => {
124125
});
125126

126127
it('should add to the PBXSourcesBuildPhase', () => {
127-
const newFile = proj.addSourceFile('Plugins/file.m');
128+
proj.addSourceFile('Plugins/file.m');
129+
128130
const sources = proj.pbxSourcesBuildPhaseObj();
129131
assert.strictEqual(sources.files.length, 3);
130132
});

test/addTarget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ describe('addTarget', () => {
178178
sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid),
179179
resourceFile = proj.addResourceFile('assets.bundle', options),
180180
resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid),
181-
frameworkFile = proj.addFramework('libsqlite3.dylib', options);
181+
frameworkFile = proj.addFramework('libsqlite3.dylib', options),
182182
frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid),
183183
headerFile = proj.addHeaderFile('file.h', options);
184184

test/addWatch2App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe('addWatchApp', () => {
8686
sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid),
8787
resourceFile = proj.addResourceFile('assets.bundle', options),
8888
resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid),
89-
frameworkFile = proj.addFramework('libsqlite3.dylib', options);
89+
frameworkFile = proj.addFramework('libsqlite3.dylib', options),
9090
frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid),
9191
headerFile = proj.addHeaderFile('file.h', options);
9292

test/addWatch2Extension.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('addWatchExtension', () => {
6565
sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid),
6666
resourceFile = proj.addResourceFile('assets.bundle', options),
6767
resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid),
68-
frameworkFile = proj.addFramework('libsqlite3.dylib', options);
68+
frameworkFile = proj.addFramework('libsqlite3.dylib', options),
6969
frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid),
7070
headerFile = proj.addHeaderFile('file.h', options);
7171

test/addWatchApp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe('addWatchApp', () => {
8686
sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid),
8787
resourceFile = proj.addResourceFile('assets.bundle', options),
8888
resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid),
89-
frameworkFile = proj.addFramework('libsqlite3.dylib', options);
89+
frameworkFile = proj.addFramework('libsqlite3.dylib', options),
9090
frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid),
9191
headerFile = proj.addHeaderFile('file.h', options);
9292

test/addWatchExtension.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('addWatchExtension', () => {
6464
sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid),
6565
resourceFile = proj.addResourceFile('assets.bundle', options),
6666
resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid),
67-
frameworkFile = proj.addFramework('libsqlite3.dylib', options);
67+
frameworkFile = proj.addFramework('libsqlite3.dylib', options),
6868
frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid),
6969
headerFile = proj.addHeaderFile('file.h', options);
7070

test/group.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ describe('group', () => {
398398
}
399399

400400
var target;
401-
var projectTargets = pbxProject.targets;
402401
for (var i = 0, j = pbxProject.targets.length; i < j; i++ ) {
403402
target = pbxProject.targets[i].value;
404403
}
@@ -419,8 +418,7 @@ describe('group', () => {
419418
}
420419
};
421420

422-
var output = project.writeSync();
423-
421+
project.writeSync();
424422
});
425423

426424
it('should add target attribute to PBXProject TargetAttributes', () => {

0 commit comments

Comments
 (0)