This repository was archived by the owner on May 15, 2023. It is now read-only.

Description
Recently upgraded from version 3.2.3 to 3.4.3 and the currency filter is not applying the thousands symbol anymore. I verified on the frontend works great but for some reason will not apply the thousands when ran from node.
failing test
test('renders renders with proper VueCurrencyFilter formatting', async t => {
const template = '<div>${{pay | currency({ fractionCount: 0 })}}</div>'
const vars = {
pay: '5000'
}
const html = await renderTemplate(template, vars)
t.is('<div>$5,000</div>', html)
})
render method
const Vue = require('vue')
const VueCurrencyFilter = require('vue-currency-filter')
const { createRenderer } = require('vue-server-renderer')
const moment = require('moment')
const renderer = createRenderer()
const { specialCharacters } = require('./utils')
Vue.use(VueCurrencyFilter, {
symbol: '$',
thousandsSeparator: ',',
fractionCount: 2,
fractionSeparator: '.',
symbolPosition: 'front',
symbolSpacing: false
})
module.exports = async function (template, data) {
const sanitized_template = template.replace(specialCharacters, '')
const app = new Vue({
template: sanitized_template,
data,
filters: {
date (val) {
return moment(val).format('M/D/YYYY')
}
}
})
const html = await renderer.renderToString(app)
return html.replace(' data-server-rendered="true"', '')
}