UNPKG

1.13 kBtext/coffeescriptView Raw
1describe 'package properties', ->
2
3 it 'should have sources', ->
4 sources = pack.sources
5 expect(sources.length).toEqual 3
6 expect(sources[0]).toBe 'src/foo.js'
7 expect(sources[1]).toBe 'src/baz.js'
8 expect(sources[2]).toBe 'src/bar.js'
9
10 it 'should have depends', ->
11 deps = pack.depends
12 expect(deps.length).toEqual 3
13 expect(deps[0]).toBe 'requires/jquery.js'
14 expect(deps[1]).toBe configs.depends[1]
15 expect(deps[2]).toBe configs.depends[2]
16
17 it 'should have test_depends', ->
18 deps = pack.testDepends
19 expect(deps.length).toEqual 2
20 expect(deps[0]).toBe 'requires/jasmine.js'
21 expect(deps[1]).toBe 'requires/jquery-test-suite.js'
22
23 it 'should have tests', ->
24 tests = pack.tests
25 expect(stub.stubs['./readdir']).toHaveBeenCalled()
26 expect(stub.stubs['./readdir'].calls[0].args[0]).toEqual opts.root+'specs'
27 expect(tests.length).toEqual 2
28 expect(tests[0]).toEqual 'specs/foo_spec.js'
29 expect(tests[1]).toEqual 'specs/bar_spec.js'
30
31 it 'should have a custom testCmd', ->
32 cmd = pack.testCmd
33 expect(cmd.indexOf(configs.test_args)).toBeGreaterThan 0
34
35