5 Prepare PostgreSQL user so PeerTube can delete/create the test databases:
8 $ sudo -u postgres createuser you_username --createdb --superuser
14 $ npm run clean:server:test
27 Run docker containers needed by some test files:
30 $ sudo docker run -p 9444:9000 chocobozzz/s3-ninja
31 $ sudo docker run -p 10389:10389 chocobozzz/docker-test-openldap
36 To run all test suites:
39 $ npm run test # See scripts/test.sh to run a particular suite
42 To run a particular test file:
45 TS_NODE_TRANSPILE_ONLY=true mocha -- --timeout 30000 --exit -r ts-node/register -r tsconfig-paths/register --bail server/tests/api/videos/video-transcoder.ts
50 Some env variables can be defined to disable/enable some tests:
52 * `DISABLE_HTTP_IMPORT_TESTS`: disable import tests (because of youtube that could rate limit your IP)
53 * `ENABLE_OBJECT_STORAGE_TESTS=true`: enable object storage tests (needs a docker container first)
60 To run tests on local web browsers (comment web browsers you don't have in `client/e2e/wdio.local.conf.ts`):
66 ### Browserstack tests
68 To run tests on browser stack:
71 $ BROWSERSTACK_USER=your_user BROWSERSTACK_KEY=your_key npm run e2e:browserstack
76 To add E2E tests and quickly run tests using a local Chrome, first create a test instance:
79 $ npm run clean:server:test && NODE_APP_INSTANCE=1 NODE_ENV=test npm start
82 Then, just run your suite using:
86 $ ../node_modules/.bin/wdio wdio.local-test.conf.ts # you can also add --mochaOpts.grep to only run tests you want