Skip to content

Commit

Permalink
Added test suite for compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
cshawaus committed Sep 30, 2020
1 parent a5c6a80 commit 8b60f30
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/support/compiler.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import webpack from 'webpack'

import {
getWebpackCompiler,
registerWebpackCompiler,
} from './compiler'

describe('compiler', () => {
const compiler = webpack({})

beforeAll(() => {
registerWebpackCompiler(compiler)
})

test('can get registered webpack compiler', () => {
expect(getWebpackCompiler()).toMatchObject(compiler)
})

test('can register a new webpack compiler', () => {
const newCompiler = webpack({})

registerWebpackCompiler(newCompiler)

expect(getWebpackCompiler()).toMatchObject(newCompiler)
expect(getWebpackCompiler()).not.toMatchObject(compiler)
})
})

0 comments on commit 8b60f30

Please sign in to comment.