test(template): from Jest to test (#6499)

This commit is contained in:
Gabriel Gunullu 2022-11-04 10:53:38 +01:00 committed by GitHub
parent c830a0b208
commit dc3446d61a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -1,7 +1,8 @@
/* eslint-env jest */
'use strict'
const { it } = require('test')
const assert = require('assert').strict
const { compileTemplate } = require('.')
it("correctly replaces the template's variables", () => {
@ -10,5 +11,5 @@ it("correctly replaces the template's variables", () => {
'{constant}': 1235,
'%': (_, i) => i,
})
expect(replacer({ name: 'bar' }, 5)).toBe('bar_{property}_\\bar_1235_5_FOO')
assert.strictEqual(replacer({ name: 'bar' }, 5), 'bar_{property}_\\bar_1235_5_FOO')
})

View File

@ -21,6 +21,10 @@
"lodash": "^4.17.15"
},
"scripts": {
"postversion": "npm publish --access public"
"postversion": "npm publish --access public",
"test": "node--test"
},
"devDependencies": {
"test": "^3.2.1"
}
}