Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest load error #4722

Closed
bingomanatee opened this issue Apr 30, 2023 · 0 comments
Closed

Jest load error #4722

bingomanatee opened this issue Apr 30, 2023 · 0 comments

Comments

@bingomanatee
Copy link

when trying to test RxDB under jest there is a strange load error:

Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    /Users/davidedelhart/Documents/repos/planboard/node_modules/pouchdb-utils/node_modules/uuid/dist/esm-browser/index.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export { default as v1 } from './v1.js';
                                                                                      ^^^^^^

    SyntaxError: Unexpected token 'export'

this is my database engine creation code:

import {
  createRxDatabase, RxDatabase
} from 'rxdb'

import { addRxPlugin } from 'rxdb';
import { RxDBDevModePlugin } from 'rxdb/plugins/dev-mode';
import { getRxStorageMemory } from 'rxdb/dist/types/plugins/storage-memory'
addRxPlugin(RxDBDevModePlugin);

export default async function createDb() : Promise<RxDatabase> {

  const base = await createRxDatabase({
    name: 'planboard',
    storage: getRxStorageMemory(),
    eventReduce: true,
    ignoreDuplicate: true,
  });
  return base as RxDatabase;
}
pubkey added a commit that referenced this issue May 2, 2023
@pubkey pubkey closed this as completed in 408c2cd May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant