Skip to content

Commit 0427fab

Browse files
committed
test: test for env var
1 parent 38c2c1b commit 0427fab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ const transpile = require('./index')
22
const Vue = require('vue')
33
const { compile } = require('vue-template-compiler')
44

5+
process.env.BAR = 'bar'
6+
57
test('should work', () => {
68
const res = compile(`
79
<div>
8-
<div>{{ foo }}</div>
10+
<div>{{ foo }} {{ process.env.BAR }}</div>
911
<div v-for="{ name } in items">{{ name }}</div>
1012
</div>
1113
`)
@@ -28,5 +30,5 @@ test('should work', () => {
2830
staticRenderFns: res.staticRenderFns.map(toFunction)
2931
}).$mount()
3032

31-
expect(vm.$el.innerHTML).toMatch(`<div>hello</div> <div>foo</div><div>bar</div>`)
33+
expect(vm.$el.innerHTML).toMatch(`<div>hello bar</div> <div>foo</div><div>bar</div>`)
3234
})

0 commit comments

Comments
 (0)