0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 02:31:30 +01:00
posthog/cypress/plugins/index.js
Karl-Aksel Puulmann 30b6692920
React component tests with cypress (#3233)
* WIP: get cypress something doing

* Get a test running

* Get css loading, stub posthog

* Move helpers to separate file

* Givens > given2

It plays nicer with beforeEach

* Test for session filters

* Test date navigation

* Test filtering

* Try keep old tests running

* Try get tests running under CI

* Prettify fixtures

* Cleanup, use cypress 6

* Add yarn build

* Fix e2e cypress tests

* given2 => givens

* Rename `frontend-test-runner` to `e2e-test-runner`

* Fix cypress test

* Add webpack-preprocessor as a devDependency

* Improve freezing time

* Make css inclusions automatic for component tests
2021-02-09 17:28:01 +02:00

19 lines
514 B
JavaScript

const webpackPreprocessor = require('@cypress/webpack-preprocessor')
const { createEntry } = require('../../webpack.config')
module.exports = (on, config) => {
const options = {
webpackOptions: createEntry('cypress'),
watchOptions: {},
}
on('file:preprocessor', webpackPreprocessor(options))
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('cypress-terminal-report/src/installLogsPrinter')(on)
} catch (e) {}
return config
}