1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

Merge pull request #150 from oceanprotocol/fix/tests

test fixes
This commit is contained in:
Matthias Kretschmann 2019-05-31 16:27:56 +02:00 committed by GitHub
commit 3386a49bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 1572 additions and 1766 deletions

View File

@ -12,10 +12,23 @@ const oceanMock = {
}
}
},
assets: {
resolve: jest.fn(),
order: () => {
return {
next: jest.fn()
}
},
consume: jest.fn()
},
keeper: {
conditions: {
accessSecretStoreCondition: {
getGrantedDidByConsumer: jest.fn()
getGrantedDidByConsumer: () => {
return {
find: jest.fn()
}
}
}
}
}

1016
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -40,6 +40,7 @@
},
"devDependencies": {
"@react-mock/state": "^0.1.8",
"@testing-library/react": "^8.0.1",
"@types/classnames": "^2.2.7",
"@types/filesize": "^4.1.0",
"@types/is-url": "^1.2.28",
@ -57,8 +58,7 @@
"jest-mock-axios": "^3.0.0",
"node-sass": "^4.12.0",
"react-scripts": "^3.0.0",
"react-testing-library": "^7.0.0",
"typescript": "^3.4.5"
"typescript": "3.4.5"
},
"repository": {
"type": "git",

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import App from './App'
import { User } from './context'
import { userMock, userMockConnected } from '../__mocks__/user-mock'

View File

@ -1,6 +1,6 @@
import React from 'react'
import { BrowserRouter as Router } from 'react-router-dom'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Routes from './Routes'
import { User } from './context'
import { userMockConnected } from '../__mocks__/user-mock'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import { toDataUrl } from 'ethereum-blockies'
import Account from './Account'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import { BrowserRouter as Router } from 'react-router-dom'
import Button from './Button'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import CategoryImage from './CategoryImage'
import formPublish from '../../data/form-publish.json'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Form from './Form'
describe('Form', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Input from './Input'
describe('Input', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import InputGroup from './InputGroup'
describe('InputGroup', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Label from './Label'
describe('Label', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Row from './Row'
describe('Row', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Markdown from './Markdown'
describe('Markdown', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render, waitForElement } from 'react-testing-library'
import { render, waitForElement } from '@testing-library/react'
import mockAxios from 'jest-mock-axios'
import VersionNumbers from './VersionNumbers'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Popover from './Popover'
import { userMock, userMockConnected } from '../../../../__mocks__/user-mock'
import { User } from '../../../context'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render, fireEvent } from 'react-testing-library'
import { render, fireEvent } from '@testing-library/react'
import AccountStatus from '.'
describe('AccountStatus', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Pagination from './Pagination'
describe('Pagination', () => {

View File

@ -1,6 +1,6 @@
import React from 'react'
import { BrowserRouter } from 'react-router-dom'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import AssetsLatest from './AssetsLatest'
import { User } from '../../context'
import { userMockConnected } from '../../../__mocks__/user-mock'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import ChannelTeaser from './ChannelTeaser'
import { BrowserRouter } from 'react-router-dom'
import { User } from '../../context'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render, fireEvent } from 'react-testing-library'
import { render, fireEvent } from '@testing-library/react'
import Web3message from './Web3message'
import { User } from '../../context'
import { userMock, userMockConnected } from '../../../__mocks__/user-mock'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import { DDO, MetaData } from '@oceanprotocol/squid'
import { BrowserRouter as Router } from 'react-router-dom'
import AssetDetails, { datafilesLine } from './AssetDetails'

View File

@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import React from 'react'
import { render, fireEvent } from 'react-testing-library'
import { render, fireEvent } from '@testing-library/react'
import { DDO } from '@oceanprotocol/squid'
import { StateMock } from '@react-mock/state'
import ReactGA from 'react-ga'
@ -16,7 +16,12 @@ const file = {
contentLength: 100
}
const ddo = ({ id: 'xxx', findServiceByType: jest.fn() } as any) as DDO
const ddo = ({
id: 'xxx',
findServiceByType: () => {
return { serviceDefinitionId: 'xxx' }
}
} as any) as DDO
ReactGA.initialize('foo', { testMode: true })

View File

@ -25,7 +25,7 @@ interface AssetFileProps {
interface AssetFileState {
isLoading: boolean
error: string
step: number | null
step: number | string | null
}
export default class AssetFile extends PureComponent<

View File

@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import { DDO } from '@oceanprotocol/squid'
import AssetFilesDetails from './AssetFilesDetails'
import { User } from '../../../context'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Details from './index'
describe('Details', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Channel from './Channel'
import { User } from '../../context'
import { createMemoryHistory } from 'history'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Route from './Route'
describe('Route', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import About from './About'
describe('About', () => {

View File

@ -1,6 +1,6 @@
import React from 'react'
import { BrowserRouter as Router } from 'react-router-dom'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Channels from './Channels'
import { User } from '../context'
import { userMockConnected } from '../../__mocks__/user-mock'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render, fireEvent } from 'react-testing-library'
import { render, fireEvent } from '@testing-library/react'
import Faucet from './Faucet'
import { User } from '../context'
import { userMockConnected } from '../../__mocks__/user-mock'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import { User } from '../context'
import History from './History'

View File

@ -1,7 +1,7 @@
import React from 'react'
import { Router } from 'react-router'
import { createBrowserHistory } from 'history'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Home from './Home'
import { userMock } from '../../__mocks__/user-mock'
import { User } from '../context'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import NotFound from './NotFound'
describe('NotFound', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Item from './Item'
describe('Item', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render, fireEvent } from 'react-testing-library'
import { render, fireEvent } from '@testing-library/react'
import ItemForm from './ItemForm'
const addItem = jest.fn()

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render, fireEvent, waitForElement } from 'react-testing-library'
import { render, fireEvent, waitForElement } from '@testing-library/react'
import Files from '.'
const onChange = jest.fn()

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Progress from './Progress'
describe('Progress', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Step from './Step'
const stateMock = {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render, fireEvent } from 'react-testing-library'
import { render, fireEvent } from '@testing-library/react'
import { BrowserRouter as Router } from 'react-router-dom'
import StepRegisterContent from './StepRegisterContent'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Publish from '.'
describe('Progress', () => {

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Search from './Search'
import { User } from '../context'
import { createMemoryHistory } from 'history'

View File

@ -1,5 +1,5 @@
import React from 'react'
import { render } from 'react-testing-library'
import { render } from '@testing-library/react'
import Styleguide from './Styleguide'
describe('Styleguide', () => {

View File

@ -1,2 +1,2 @@
import 'jest-dom/extend-expect'
import 'react-testing-library/cleanup-after-each'
import '@testing-library/react/cleanup-after-each'

2039
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,7 @@
"stylelint-config-bigchaindb": "^1.2.2",
"stylelint-config-css-modules": "^1.4.0",
"stylelint-config-standard": "^18.3.0",
"typescript": "^3.4.5"
"typescript": "3.4.5"
},
"repository": {
"type": "git",
@ -53,8 +53,11 @@
"@release-it/bumper": {
"out": [
"package.json",
"package-lock.json",
"client/package.json",
"server/package.json"
"client/package-lock.json",
"server/package.json",
"server/package-lock.json"
]
}
},

141
server/package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "commons-server",
"version": "0.4.0",
"version": "0.4.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -14,17 +14,17 @@
}
},
"@babel/core": {
"version": "7.4.4",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.4.4.tgz",
"integrity": "sha512-lQgGX3FPRgbz2SKmhMtYgJvVzGZrmjaF4apZ2bLwofAKiSjxU0drPh4S/VasyYXwaTs+A1gvQ45BN8SQJzHsQQ==",
"version": "7.4.5",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.4.5.tgz",
"integrity": "sha512-OvjIh6aqXtlsA8ujtGKfC7LYWksYSX8yQcM8Ay3LuvVeQ63lcOKgoZWVqcpFwkd29aYU9rVx7jxhfhiEDV9MZA==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
"@babel/generator": "^7.4.4",
"@babel/helpers": "^7.4.4",
"@babel/parser": "^7.4.4",
"@babel/parser": "^7.4.5",
"@babel/template": "^7.4.4",
"@babel/traverse": "^7.4.4",
"@babel/traverse": "^7.4.5",
"@babel/types": "^7.4.4",
"convert-source-map": "^1.1.0",
"debug": "^4.1.0",
@ -122,9 +122,9 @@
}
},
"@babel/parser": {
"version": "7.4.4",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.4.tgz",
"integrity": "sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w==",
"version": "7.4.5",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.5.tgz",
"integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==",
"dev": true
},
"@babel/plugin-syntax-object-rest-spread": {
@ -148,16 +148,16 @@
}
},
"@babel/traverse": {
"version": "7.4.4",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.4.tgz",
"integrity": "sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A==",
"version": "7.4.5",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.5.tgz",
"integrity": "sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
"@babel/generator": "^7.4.4",
"@babel/helper-function-name": "^7.1.0",
"@babel/helper-split-export-declaration": "^7.4.4",
"@babel/parser": "^7.4.4",
"@babel/parser": "^7.4.5",
"@babel/types": "^7.4.4",
"debug": "^4.1.0",
"globals": "^11.1.0",
@ -426,6 +426,12 @@
"@types/node": "*"
}
},
"@types/cookiejar": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.1.tgz",
"integrity": "sha512-aRnpPa7ysx3aNW60hTiCtLHlQaIFsXFCgQlpakNgDNVFzbtusSY8PwjAQgRWfSk0ekNoBjO51eQRB6upA9uuyw==",
"dev": true
},
"@types/debug": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.4.tgz",
@ -444,9 +450,9 @@
}
},
"@types/express-serve-static-core": {
"version": "4.16.4",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.4.tgz",
"integrity": "sha512-x/8h6FHm14rPWnW2HP5likD/rsqJ3t/77OWx2PLxym0hXbeBWQmcPyHmwX+CtCQpjIfgrUdEoDFcLPwPZWiqzQ==",
"version": "4.16.6",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.6.tgz",
"integrity": "sha512-8wr3CA/EMybyb6/V8qvTRKiNkPmgUA26uA9XWD6hlA0yFDuqi4r2L0C2B0U2HAYltJamoYJszlkaWM31vrKsHg==",
"dev": true,
"requires": {
"@types/node": "*",
@ -487,12 +493,6 @@
"@types/istanbul-lib-report": "*"
}
},
"@types/jasmine": {
"version": "3.3.12",
"resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.3.12.tgz",
"integrity": "sha512-lXvr2xFQEVQLkIhuGaR3GC1L9lMU1IxeWnAF/wNY5ZWpC4p9dgxkKkzMp7pntpAdv9pZSnYqgsBkCg32MXSZMg==",
"dev": true
},
"@types/jest": {
"version": "24.0.13",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.13.tgz",
@ -524,9 +524,9 @@
}
},
"@types/node": {
"version": "11.13.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.11.tgz",
"integrity": "sha512-blLeR+KIy26km1OU8yTLUlSyVCOvT6+wPq/77tIA+uSHHa4yYQosn+bbaJqPtWId0wjVClUtD7aXzDbZeKWqig==",
"version": "11.13.13",
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.13.tgz",
"integrity": "sha512-GFWH7e4Q/OGLAO545bupVju+nE1YtLSwYAdLfSzAXnTPqoqKoXCOEtB7Cluvg9B/h2nGLhyzCDyCInYvrOE2nw==",
"dev": true
},
"@types/range-parser": {
@ -563,6 +563,25 @@
"integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==",
"dev": true
},
"@types/superagent": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.1.tgz",
"integrity": "sha512-NetXrraTWPcdGG6IwYJhJ5esUGx8AYNiozbc1ENWEsF6BsD4JmNODJczI6Rm1xFPVp6HZESds9YCfqz4zIsM6A==",
"dev": true,
"requires": {
"@types/cookiejar": "*",
"@types/node": "*"
}
},
"@types/supertest": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.7.tgz",
"integrity": "sha512-GibTh4OTkal71btYe2fpZP/rVHIPnnUsYphEaoywVHo+mo2a/LhlOFkIm5wdN0H0DA0Hx8x+tKgCYMD9elHu5w==",
"dev": true,
"requires": {
"@types/superagent": "*"
}
},
"@types/tough-cookie": {
"version": "2.3.5",
"resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.5.tgz",
@ -1557,9 +1576,9 @@
"dev": true
},
"diff": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
"dev": true
},
"diff-sequences": {
@ -1787,9 +1806,9 @@
}
},
"express": {
"version": "4.17.0",
"resolved": "https://registry.npmjs.org/express/-/express-4.17.0.tgz",
"integrity": "sha512-1Z7/t3Z5ZnBG252gKUPyItc4xdeaA0X934ca2ewckAsVsw9EG71i++ZHZPYnus8g/s5Bty8IMpSVEuRkmwwPRQ==",
"version": "4.17.1",
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
"integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
"requires": {
"accepts": "~1.3.7",
"array-flatten": "1.1.1",
@ -3228,9 +3247,9 @@
},
"dependencies": {
"semver": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz",
"integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==",
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz",
"integrity": "sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==",
"dev": true
}
}
@ -3279,22 +3298,6 @@
"handlebars": "^4.1.2"
}
},
"jasmine": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.4.0.tgz",
"integrity": "sha512-sR9b4n+fnBFDEd7VS2el2DeHgKcPiMVn44rtKFumq9q7P/t8WrxsVIZPob4UDdgcDNCwyDqwxCt4k9TDRmjPoQ==",
"dev": true,
"requires": {
"glob": "^7.1.3",
"jasmine-core": "~3.4.0"
}
},
"jasmine-core": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.4.0.tgz",
"integrity": "sha512-HU/YxV4i6GcmiH4duATwAbJQMlE0MsDIR5XmSVxURxKHn3aGAdbY1/ZJFmVRbKtnLwIxxMJD7gYaPsypcbYimg==",
"dev": true
},
"jest": {
"version": "24.8.0",
"resolved": "https://registry.npmjs.org/jest/-/jest-24.8.0.tgz",
@ -4205,9 +4208,9 @@
}
},
"nodemon": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.0.tgz",
"integrity": "sha512-NHKpb/Je0Urmwi3QPDHlYuFY9m1vaVfTsRZG5X73rY46xPj0JpNe8WhUGQdkDXQDOxrBNIU3JrcflE9Y44EcuA==",
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.1.tgz",
"integrity": "sha512-/DXLzd/GhiaDXXbGId5BzxP1GlsqtMGM9zTmkWrgXtSqjKmGSbLicM/oAy4FR0YWm14jCHRwnR31AHS2dYFHrg==",
"dev": true,
"requires": {
"chokidar": "^2.1.5",
@ -4651,9 +4654,9 @@
"dev": true
},
"prompts": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/prompts/-/prompts-2.0.4.tgz",
"integrity": "sha512-HTzM3UWp/99A0gk51gAegwo1QRYA7xjcZufMNe33rCclFszUYAuHe1fIN/3ZmiHeGPkUsNaRyQm1hHOfM0PKxA==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/prompts/-/prompts-2.1.0.tgz",
"integrity": "sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg==",
"dev": true,
"requires": {
"kleur": "^3.0.2",
@ -4676,14 +4679,14 @@
"dev": true
},
"psl": {
"version": "1.1.31",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz",
"integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw=="
"version": "1.1.32",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.32.tgz",
"integrity": "sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g=="
},
"pstree.remy": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.6.tgz",
"integrity": "sha512-NdF35+QsqD7EgNEI5mkI/X+UwaxVEbQaz9f4IooEmMUv6ZPmlTQYGjBPJGgrlzNdjSvIy4MWMg6Q6vCgBO2K+w==",
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.7.tgz",
"integrity": "sha512-xsMgrUwRpuGskEzBFkH8NmTimbZ5PcPup0LA8JJkHIm2IMUbQcpo3yeLNWVrufEYjh8YwtSVh0xz6UeWc5Oh5A==",
"dev": true
},
"pump": {
@ -5746,13 +5749,13 @@
}
},
"ts-node": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.1.0.tgz",
"integrity": "sha512-34jpuOrxDuf+O6iW1JpgTRDFynUZ1iEqtYruBqh35gICNjN8x+LpVcPAcwzLPi9VU6mdA3ym+x233nZmZp445A==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.2.0.tgz",
"integrity": "sha512-m8XQwUurkbYqXrKqr3WHCW310utRNvV5OnRVeISeea7LoCWVcdfeB/Ntl8JYWFh+WRoUAdBgESrzKochQt7sMw==",
"dev": true,
"requires": {
"arg": "^4.1.0",
"diff": "^3.1.0",
"diff": "^4.0.1",
"make-error": "^1.1.1",
"source-map-support": "^0.5.6",
"yn": "^3.0.0"
@ -5796,9 +5799,9 @@
"dev": true
},
"uglify-js": {
"version": "3.5.14",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.14.tgz",
"integrity": "sha512-dgyjIw8KFK6AyVl5vm2tEqPewv5TKGEiiVFLI1LbF+oHua/Njd8tZk3lIbF1AWU1rNdEg7scaceADb4zqCcWXg==",
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz",
"integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==",
"dev": true,
"optional": true,
"requires": {

View File

@ -16,7 +16,7 @@
"body-parser": "^1.18.3",
"compression": "^1.7.4",
"debug": "^4.1.1",
"express": "^4.16.4",
"express": "^4.17.1",
"express-validator": "^5.3.1",
"morgan": "^1.9.1",
"request": "^2.88.0"
@ -26,18 +26,17 @@
"@types/compression": "0.0.36",
"@types/debug": "^4.1.4",
"@types/express": "^4.16.1",
"@types/jasmine": "^3.3.12",
"@types/jest": "^24.0.11",
"@types/jest": "^24.0.13",
"@types/morgan": "^1.7.35",
"@types/node": "^11.13.4",
"@types/request": "^2.48.1",
"jasmine": "^3.4.0",
"jest": "^24.7.1",
"nodemon": "^1.18.11",
"@types/supertest": "^2.0.7",
"jest": "^24.8.0",
"nodemon": "^1.19.1",
"supertest": "^4.0.2",
"ts-jest": "^24.0.2",
"ts-node": "^8.1.0",
"typescript": "^3.4.5"
"ts-node": "^8.2.0",
"typescript": "3.4.5"
},
"repository": {
"type": "git",

View File

@ -1,6 +1,5 @@
import request from 'supertest'
import server from '../src/server'
import {} from 'jasmine'
afterAll(done => {
server.close(done)
@ -9,7 +8,7 @@ afterAll(done => {
describe('POST /api/v1/urlcheck', () => {
it('responds with json', async () => {
const response = await request(server).post('/api/v1/urlcheck')
expect(response.statusCode).toBe(200)
expect(response.status).toBe(200)
})
it('responds with error message when url is missing', async () => {
@ -22,6 +21,6 @@ describe('POST /api/v1/urlcheck', () => {
describe('Errors', () => {
it('responds with 404 on unknown path', async () => {
const response = await request(server).post('/whatever')
expect(response.statusCode).toBe(404)
expect(response.status).toBe(404)
})
})

View File

@ -9,10 +9,9 @@
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": ["node_modules/*", "src/types/*"]
"*": ["node_modules/*"]
},
"types": ["node"],
"typeRoots": ["node_modules/@types"]
"types": ["node", "jest"]
},
"include": ["src/**/*"]
"include": ["src/**/*", "test/**/*"]
}