Reputation: 512
[email protected] does not seem to work with [email protected], I end up with the following error:
Unexpected token 'export'
({"Object.":function(module,exports,require,__dirname,__filename,jest){export * from './adapters/JSONFile.js';
Does anyone know how to fix it?
My sample index.test.ts code:
import { Low, JSONFile } from 'lowdb'
it('test file upload', async () => {
const adapter = new JSONFile("db.json")
const db = new Low(adapter)
console.log("Test:", db)
})
I have tried the following babel.config.js:
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
'@babel/preset-typescript',
],
};
Upvotes: 1
Views: 263