ActivityPub-federated video streaming platform using P2P directly in your web browser
Remove jest tests
Chocobozzzd0e1e32589f4
diff --git a/.travis.yml b/.travis.ymlindex d252ae6252..dcf7247b2d 100644--- a/.travis.yml+++ b/.travis.yml@@ -45,7 +45,6 @@ matrix:- env: TEST_SUITE=api-4- env: TEST_SUITE=cli- env: TEST_SUITE=lint- - env: TEST_SUITE=jestscript:- NODE_PENDING_JOB_WAIT=1000 travis_retry npm run travis -- "$TEST_SUITE"diff --git a/client/package.json b/client/package.jsonindex 72708bd765..a8205a6b99 100644--- a/client/package.json+++ b/client/package.json@@ -20,8 +20,7 @@"postinstall": "npm rebuild node-sass","webpack-bundle-analyzer": "webpack-bundle-analyzer","webdriver-manager": "webdriver-manager",- "ngx-extractor": "ngx-extractor",- "test": "jest --no-cache"+ "ngx-extractor": "ngx-extractor"},"license": "GPLv3","typings": "*.d.ts",@@ -31,38 +30,6 @@"simple-get": "^2.8.1","punycode": "^1.4.1"},- "jest": {- "globals": {- "ts-jest": {- "tsConfigFile": "<rootDir>/src/tsconfig.spec.json"- },- "__TRANSFORM_HTML__": true- },- "transform": {- "^.+\\.(ts|js|html)$": "<rootDir>/node_modules/jest-preset-angular/preprocessor.js"- },- "moduleNameMapper": {- "^@app/(.*)": "<rootDir>/src/app/$1",- "environments/(.*)": "<rootDir>/src/environments/$1"- },- "testMatch": [- "**/__tests__/**/*.+(ts|js)?(x)",- "**/+(*.)+(spec|test).+(ts|js)?(x)"- ],- "moduleFileExtensions": [- "ts",- "tsx",- "js",- "jsx",- "json",- "node"- ],- "transformIgnorePatterns": [- "<rootDir>/node_modules/(?!lodash-es/)"- ],- "preset": "jest-preset-angular",- "setupTestFrameworkScriptFile": "<rootDir>/src/setupJest.ts"- },"devDependencies": {"@angular-devkit/build-angular": "~0.13.1","@angular/animations": "~7.2.4",@@ -92,7 +59,6 @@"@types/hls.js": "^0.12.0","@types/jasmine": "^2.8.7","@types/jasminewd2": "^2.0.3",- "@types/jest": "^23.3.1","@types/jschannel": "^1.0.0","@types/linkifyjs": "^2.1.1","@types/lodash-es": "^4.17.0",@@ -120,8 +86,6 @@"https-browserify": "^1.0.0","jasmine-core": "^3.1.0","jasmine-spec-reporter": "^4.2.1",- "jest": "^23.5.0",- "jest-preset-angular": "^6.0.0","jschannel": "^1.0.2","karma": "^3.0.0","karma-chrome-launcher": "^2.2.0",@@ -153,7 +117,6 @@"stream-browserify": "^2.0.1","stream-http": "^3.0.0","terser-webpack-plugin": "^1.1.0",- "ts-jest": "^23.1.4","tslint": "^5.7.0","tslint-config-standard": "^8.0.1","typescript": "3.2",diff --git a/client/src/app/videos/recommendations/recent-videos-recommendation.service.spec.ts b/client/src/app/videos/recommendations/recent-videos-recommendation.service.spec.tsdeleted file mode 100644index 698b2e27b2..0000000000--- a/client/src/app/videos/recommendations/recent-videos-recommendation.service.spec.ts+++ /dev/null@@ -1,66 +0,0 @@-import { RecentVideosRecommendationService } from '@app/videos/recommendations/recent-videos-recommendation.service'-import { VideosProvider } from '@app/shared/video/video.service'-import { EMPTY, of } from 'rxjs'-import Mock = jest.Mock--describe('"Recent Videos" Recommender', () => {- describe('getRecommendations', () => {- let videosService: VideosProvider- let service: RecentVideosRecommendationService- let getVideosMock: Mock<any>- beforeEach(() => {- getVideosMock = jest.fn(() => EMPTY)- videosService = {- getVideos: getVideosMock- }- service = new RecentVideosRecommendationService(videosService)- })- it('should filter out the given UUID from the results', async (done) => {- const vids = [- { uuid: 'uuid1' },- { uuid: 'uuid2' }- ]- getVideosMock.mockReturnValueOnce(of({ videos: vids }))- const result = await service.getRecommendations({ uuid: 'uuid1' }).toPromise()- const uuids = result.map(v => v.uuid)- expect(uuids).toEqual(['uuid2'])- done()- })- it('should return 5 results when the given UUID is NOT in the first 5 results', async (done) => {- const vids = [- { uuid: 'uuid2' },- { uuid: 'uuid3' },- { uuid: 'uuid4' },- { uuid: 'uuid5' },- { uuid: 'uuid6' },- { uuid: 'uuid7' }- ]- getVideosMock.mockReturnValueOnce(of({ videos: vids }))- const result = await service.getRecommendations({ uuid: 'uuid1' }).toPromise()- expect(result.length).toEqual(5)- done()- })- it('should return 5 results when the given UUID IS PRESENT in the first 5 results', async (done) => {- const vids = [- { uuid: 'uuid1' },- { uuid: 'uuid2' },- { uuid: 'uuid3' },- { uuid: 'uuid4' },- { uuid: 'uuid5' },- { uuid: 'uuid6' }- ]- getVideosMock- .mockReturnValueOnce(of({ videos: vids }))- const result = await service.getRecommendations({ uuid: 'uuid1' }).toPromise()- expect(result.length).toEqual(5)- done()- })- it('should fetch an extra result in case the given UUID is in the list', async (done) => {- await service.getRecommendations({ uuid: 'uuid1' }).toPromise()- let expectedSize = service.pageSize + 1- let params = { currentPage: jasmine.anything(), itemsPerPage: expectedSize }- expect(getVideosMock).toHaveBeenCalledWith(params, jasmine.anything())- done()- })- })-})diff --git a/client/src/app/videos/recommendations/recommended-videos.store.spec.ts b/client/src/app/videos/recommendations/recommended-videos.store.spec.tsdeleted file mode 100644index e12a3f520f..0000000000--- a/client/src/app/videos/recommendations/recommended-videos.store.spec.ts+++ /dev/null@@ -1,22 +0,0 @@-import { RecommendedVideosStore } from '@app/videos/recommendations/recommended-videos.store'-import { RecommendationService } from '@app/videos/recommendations/recommendations.service'--describe('RecommendedVideosStore', () => {- describe('requestNewRecommendations', () => {- let store: RecommendedVideosStore- let service: RecommendationService- beforeEach(() => {- service = {- getRecommendations: jest.fn(() => new Promise((r) => r()))- }- store = new RecommendedVideosStore(service)- })- it('should pull new videos from the service one time when given the same UUID twice', () => {- store.requestNewRecommendations('some-uuid')- store.requestNewRecommendations('some-uuid')- // Requests aren't fulfilled until someone asks for them (ie: subscribes)- store.recommendations$.subscribe()- expect(service.getRecommendations).toHaveBeenCalledTimes(1)- })- })-})diff --git a/client/src/setupJest.ts b/client/src/setupJest.tsdeleted file mode 100644index 8d88704e8f..0000000000--- a/client/src/setupJest.ts+++ /dev/null@@ -1 +0,0 @@-import 'jest-preset-angular';diff --git a/client/src/tsconfig.spec.json b/client/src/tsconfig.spec.jsondeleted file mode 100644index cefee17812..0000000000--- a/client/src/tsconfig.spec.json+++ /dev/null@@ -1,17 +0,0 @@-{- "extends": "../tsconfig.json",- "compilerOptions": {- "outDir": "../out-tsc/spec",- "module": "commonjs",- "target": "es5",- "baseUrl": "",- "allowJs": true- },- "files": [- "test.ts"- ],- "include": [- "**/*.spec.ts",- "**/*.d.ts"- ]-}diff --git a/scripts/travis.sh b/scripts/travis.shindex 509b40d873..3557816c8c 100755--- a/scripts/travis.sh+++ b/scripts/travis.sh@@ -36,8 +36,4 @@ elif [ "$1" = "lint" ]; then( cd clientnpm run lint)-elif [ "$1" = "jest" ]; then- ( cd client- npm run test- )fi