Skip to content

Commit 0721708

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

File tree

10 files changed

+46
-53
lines changed

10 files changed

+46
-53
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/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', () => {

test/pbxFile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
under the License.
1818
*/
1919

20-
const { describe, it, beforeEach } = require('node:test');
20+
const { describe, it } = require('node:test');
2121
const assert = require('node:assert');
2222

2323
var pbxFile = require('../lib/pbxFile');

test/removeFramework.js

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,22 @@ describe('removeFramework', () => {
6565

6666
it('should return a pbxFile', () => {
6767
var newFile = proj.addFramework('libsqlite3.dylib');
68-
6968
assert.equal(newFile.constructor, pbxFile);
7069

7170
var deletedFile = proj.removeFramework('libsqlite3.dylib');
72-
7371
assert.equal(deletedFile.constructor, pbxFile);
7472
});
7573

7674
it('should set a fileRef on the pbxFile', () => {
7775
var newFile = proj.addFramework('libsqlite3.dylib');
78-
7976
assert.ok(newFile.fileRef);
8077

8178
var deletedFile = proj.removeFramework('libsqlite3.dylib');
82-
8379
assert.ok(deletedFile.fileRef);
8480
});
8581

8682
it('should remove 2 fields from the PBXFileReference section', () => {
87-
var newFile = proj.addFramework('libsqlite3.dylib');
83+
var newFile = proj.addFramework('libsqlite3.dylib'),
8884
fileRefSection = proj.pbxFileReferenceSection(),
8985
frsLength = Object.keys(fileRefSection).length;
9086

@@ -110,7 +106,6 @@ describe('removeFramework', () => {
110106
assert.ok(buildFileSection[newFile.uuid + '_comment']);
111107

112108
var deletedFile = proj.removeFramework('libsqlite3.dylib');
113-
114109
bfsLength = Object.keys(buildFileSection).length;
115110

116111
assert.equal(58, bfsLength);
@@ -119,42 +114,42 @@ describe('removeFramework', () => {
119114
});
120115

121116
it('should remove from the Frameworks PBXGroup', () => {
122-
var newLength = proj.pbxGroupByName('Frameworks').children.length + 1,
123-
newFile = proj.addFramework('libsqlite3.dylib'),
124-
frameworks = proj.pbxGroupByName('Frameworks');
117+
var newLength = proj.pbxGroupByName('Frameworks').children.length + 1;
118+
proj.addFramework('libsqlite3.dylib');
125119

120+
var frameworks = proj.pbxGroupByName('Frameworks');
126121
assert.equal(frameworks.children.length, newLength);
127122

128-
var deletedFile = proj.removeFramework('libsqlite3.dylib'),
123+
proj.removeFramework('libsqlite3.dylib'),
129124
newLength = newLength - 1;
130125

131126
assert.equal(frameworks.children.length, newLength);
132127
});
133128

134129
it('should remove from the PBXFrameworksBuildPhase', () => {
135-
var newFile = proj.addFramework('libsqlite3.dylib'),
136-
frameworks = proj.pbxFrameworksBuildPhaseObj();
130+
proj.addFramework('libsqlite3.dylib');
137131

132+
var frameworks = proj.pbxFrameworksBuildPhaseObj();
138133
assert.equal(frameworks.files.length, 16);
139134

140-
var deletedFile = proj.removeFramework('libsqlite3.dylib'),
141-
frameworks = proj.pbxFrameworksBuildPhaseObj();
135+
proj.removeFramework('libsqlite3.dylib');
142136

137+
frameworks = proj.pbxFrameworksBuildPhaseObj();
143138
assert.equal(frameworks.files.length, 15);
144139
});
145140

146141
it('should remove custom frameworks', () => {
147-
var newFile = proj.addFramework('/path/to/Custom.framework', { customFramework: true }),
148-
frameworks = proj.pbxFrameworksBuildPhaseObj();
142+
proj.addFramework('/path/to/Custom.framework', { customFramework: true });
149143

144+
var frameworks = proj.pbxFrameworksBuildPhaseObj();
150145
assert.equal(frameworks.files.length, 16);
151146

152-
var deletedFile = proj.removeFramework('/path/to/Custom.framework', { customFramework: true }),
153-
frameworks = proj.pbxFrameworksBuildPhaseObj();
147+
proj.removeFramework('/path/to/Custom.framework', { customFramework: true });
154148

149+
frameworks = proj.pbxFrameworksBuildPhaseObj();
155150
assert.equal(frameworks.files.length, 15);
156151

157-
var frameworkPaths = frameworkSearchPaths(proj);
152+
var frameworkPaths = frameworkSearchPaths(proj),
158153
expectedPath = '"/path/to"';
159154

160155
for (i = 0; i < frameworkPaths.length; i++) {
@@ -165,16 +160,18 @@ describe('removeFramework', () => {
165160
});
166161

167162
it('should remove embedded frameworks', () => {
168-
var newFile = proj.addFramework('/path/to/Custom.framework', { customFramework: true, embed:true, sign:true }),
169-
frameworks = proj.pbxFrameworksBuildPhaseObj(),
163+
proj.addFramework('/path/to/Custom.framework', { customFramework: true, embed:true, sign:true });
164+
165+
var frameworks = proj.pbxFrameworksBuildPhaseObj(),
170166
buildFileSection = proj.pbxBuildFileSection(),
171167
bfsLength = Object.keys(buildFileSection).length;
172168

173169
assert.equal(frameworks.files.length, 16);
174170
assert.equal(62, bfsLength);
175171

176-
var deletedFile = proj.removeFramework('/path/to/Custom.framework', { customFramework: true, embed:true }),
177-
frameworks = proj.pbxFrameworksBuildPhaseObj(),
172+
proj.removeFramework('/path/to/Custom.framework', { customFramework: true, embed:true });
173+
174+
frameworks = proj.pbxFrameworksBuildPhaseObj(),
178175
buildFileSection = proj.pbxBuildFileSection(),
179176
bfsLength = Object.keys(buildFileSection).length;
180177

0 commit comments

Comments
 (0)