You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
495 B
18 lines
495 B
const { exec } = require('shelljs')
|
|
|
|
const checkCode = `
|
|
const isAsyncSupported = require('./index')
|
|
console.log(isAsyncSupported())
|
|
`
|
|
|
|
test('With harmony', () => {
|
|
const executed = exec(`echo "${checkCode}" | node --harmony-async-await`)
|
|
expect(executed.code).toBe(0)
|
|
expect(executed.stdout.trim()).toBe('true')
|
|
})
|
|
|
|
test('Without harmony', () => {
|
|
const executed = exec(`echo "${checkCode}" | node`)
|
|
expect(executed.code).toBe(0)
|
|
expect(executed.stdout.trim()).toBe('false')
|
|
})
|
|
|