Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 0bc208a

Browse files
Update spec
1 parent 0b430fb commit 0bc208a

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

spec/list-spec.coffee

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,19 @@ describe 'apm list', ->
8888
listPackages [], ->
8989
expect(console.log.argsForCall[1][0]).toContain '[email protected] (disabled)'
9090

91-
it 'displays only enabled packages --enabled is called', ->
91+
it 'displays only enabled packages when --enabled is called', ->
92+
atomPackages =
93+
'test-module':
94+
metadata:
95+
name: 'test-module'
96+
version: '1.0.0'
97+
'test2-module':
98+
metadata:
99+
name: 'test2-module'
100+
version: '1.0.0'
101+
102+
fs.writeFileSync(path.join(resourcePath, 'package.json'), JSON.stringify(_atomPackages: atomPackages))
103+
92104
packagesPath = path.join(atomHome, 'packages')
93105
fs.makeTreeSync(packagesPath)
94106
wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures', 'test-module'), path.join(packagesPath, 'test-module'))
@@ -97,7 +109,10 @@ describe 'apm list', ->
97109
core: disabledPackages: ["test-module"]
98110

99111
listPackages ['--enabled'], ->
100-
expect(console.log.argsForCall[1][0]).toContain '(empty)'
112+
expect(console.log.argsForCall[1][0]).toContain '[email protected]'
113+
expect(console.log.argsForCall[3][0]).toContain '[email protected]'
114+
expect(console.log.argsForCall[6][0]).toContain '[email protected]'
115+
expect(console.log.argsForCall[9][0]).toContain '[email protected]'
101116

102117
it 'lists packages in json format when --json is passed', ->
103118
listPackages ['--json'], ->

0 commit comments

Comments
 (0)