const jestJupyterLab = require('@jupyterlab/testutils/lib/jest-config');

const esModules = ['@codemirror', '@jupyter/ydoc', '@jupyterlab/', 'lib0', 'nanoid', 'vscode-ws-jsonrpc', 'y-protocols', 'y-websocket', 'yjs'].join(
  '|'
);

const baseConfig = jestJupyterLab(__dirname);

module.exports = {
  ...baseConfig,
  automock: false,
  collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts', '!src/**/.ipynb_checkpoints/*'],
  coverageReporters: ['lcov', 'text'],
  testRegex: 'src/.*/.*.spec.ts[x]?$',
  setupFiles: ['<rootDir>/jest.polyfills.js', ...baseConfig.setupFiles],
  transformIgnorePatterns: [`/node_modules/(?!${esModules}).+`]
};
