Skip to content

Commit

Permalink
test: Add test for first-run compile of static resources
Browse files Browse the repository at this point in the history
  • Loading branch information
EzraBrooks committed Nov 26, 2017
1 parent e4d6850 commit 4674360
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/unit/server.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Server from '../../lib/server'
import BrowserCollection from '../../lib/browser_collection'
import * as fs from 'fs'
import * as path from 'path'

describe('server', () => {
var mockConfig
Expand Down Expand Up @@ -103,6 +105,17 @@ describe('server', () => {
// server._start()
// ============================================================================
describe('_start', () => {
it('should compile static resources on first run', function (done) {
this.timeout(5000)
server._start(mockConfig, mockLauncher, null, mockFileList, browserCollection, mockExecutor, doneSpy)
fileListOnResolve()

setTimeout(() => {
expect(fs.existsSync(path.join(__dirname, '/../../static/karma.js')) && fs.existsSync(path.join(__dirname, '/../../static/context.js'))).to.be.true
done()
}, 4000)
})

it('should start the web server after all files have been preprocessed successfully', () => {
server._start(mockConfig, mockLauncher, null, mockFileList, browserCollection, mockExecutor, doneSpy)

Expand Down

0 comments on commit 4674360

Please sign in to comment.