Skip to content

Commit 57e767f

Browse files
committed
fix: fix tests
1 parent 22a591c commit 57e767f

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed

tests/unit/configure-hook-test.js

+15-24
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ describe('Manifest Json | configure hook', function() {
1818
}
1919
})
2020

21-
describe('required config', function() {
22-
it('warns about missing config props', function() {
21+
describe('default config', function() {
22+
it('provides some default values', function() {
2323
let instance = subject.createDeployPlugin({
2424
name: 'manifest-json'
2525
})
@@ -32,44 +32,35 @@ describe('Manifest Json | configure hook', function() {
3232
}
3333

3434
instance.beforeHook(context)
35+
instance.configure(context)
3536

36-
assert.throws(function() {
37-
instance.configure(context)
38-
})
39-
40-
let s = 'Missing required config: `isInNeedOfSleep`'
41-
assert.match(mockUi.messages.pop(), new RegExp(s))
42-
})
43-
})
44-
45-
describe('default config', function() {
46-
let config
47-
48-
beforeEach(function() {
49-
config = {
50-
isInNeedOfSleep: true,
51-
meaningOfLife: 99
52-
}
37+
assert.ok(instance.readConfig('filePattern'))
38+
assert.equal(instance.readConfig('fileIgnorePattern'), null)
39+
assert.ok(instance.readConfig('indexPath'))
5340
})
5441

55-
it('provides default meaning of life', function() {
42+
it('has overridable default values', function() {
5643
let instance = subject.createDeployPlugin({
5744
name: 'manifest-json'
5845
})
5946

60-
delete config.meaningOfLife
61-
6247
let context = {
6348
ui: mockUi,
6449
config: {
65-
'manifest-json': config
50+
'manifest-json': {
51+
filePattern: '**/*',
52+
fileIgnorePattern: 'nope',
53+
indexPath: 'index.json'
54+
}
6655
}
6756
}
6857

6958
instance.beforeHook(context)
7059
instance.configure(context)
7160

72-
assert.equal(instance.readConfig('meaningOfLife'), 42)
61+
assert.ok(instance.readConfig('filePattern'), '**/*')
62+
assert.ok(instance.readConfig('fileIgnorePattern'), 'nope')
63+
assert.ok(instance.readConfig('indexPath'), 'index.json')
7364
})
7465
})
7566
})

0 commit comments

Comments
 (0)