Changeset View
Changeset View
Standalone View
Standalone View
cypress/utils/index.js
/** | /** | ||||
* Copyright (C) 2019 The Software Heritage developers | * Copyright (C) 2019 The Software Heritage developers | ||||
* See the AUTHORS file at the top-level directory of this distribution | * See the AUTHORS file at the top-level directory of this distribution | ||||
* License: GNU Affero General Public License version 3, or any later version | * License: GNU Affero General Public License version 3, or any later version | ||||
* See top-level LICENSE file for more information | * See top-level LICENSE file for more information | ||||
*/ | */ | ||||
import axios from 'axios'; | import axios from 'axios'; | ||||
export async function httpGetJson(url) { | export async function httpGetJson(url) { | ||||
const response = await axios.get(url); | const response = await axios.get(url); | ||||
return response.data; | return response.data; | ||||
} | } | ||||
export function random(start, end) { | |||||
const range = end - start; | |||||
return Math.floor(Math.random() * range) + start; | |||||
} |