{"size": 834, "ext": "js", "max_stars_repo_path": "tests/api.test.js", "max_stars_repo_name": "Jesmv/paddlesurf-api", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "tests/api.test.js", "max_issues_repo_name": "Jesmv/paddlesurf-api", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "tests/api.test.js", "max_forks_repo_name": "Jesmv/paddlesurf-api", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 36.2608695652, "max_line_length": 84, "alphanum_fraction": 0.6966426859}
const axios = require('axios');

const BASE_URL = process.env['BASE_URL'] || 'http://localhost:3700';

test('GET /tabhinchable devuelve lista tablas', async () => {
    const response = await axios.get(`${BASE_URL}/api/tabhinchable`);

    expect(Array.isArray(response.data.tabHinchable)).toBe(true);
});

test('POST /tabhinchable crea documento', async() => {
    const response = await axios.post(`${BASE_URL}/api/tabhinchable`);
    expect(response.status).toBe(200);
});

test('DELETE /tabhinchable elimina tabla', async() => {
    const response = await axios.post(`${BASE_URL}/api/tabhinchable`);
    const id = response.data.tabHinchable._id;
    const deleteResponse = await axios.delete(`${BASE_URL}/api/tabhinchable/${id}`);
    expect(deleteResponse.status).toBe(200);
});

test.todo('GET /tabhinchable/id devuelve tabla')