Skip to content

Commit

Permalink
refactor(review): change url
Browse files Browse the repository at this point in the history
  • Loading branch information
ftoromanoff committed Mar 13, 2024
1 parent a4ca5b7 commit ba2226c
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions test/unit/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { HttpsProxyAgent } from 'https-proxy-agent';
import Fetcher from 'Provider/Fetcher';
import { DataTexture, Texture } from 'three';

const itownsdataUrl = 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master';

describe('Fetcher', function () {
const networkOptions = process.env.HTTPS_PROXY ? { agent: new HttpsProxyAgent(process.env.HTTPS_PROXY) } : {};
describe('text', function () {
const url = 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/' +
'altitude-conversion-grids/EGM2008.gdf';
const url = `${itownsdataUrl}/altitude-conversion-grids/EGM2008.gdf`;
it('should load a text file', (done) => {
Fetcher.text(url, networkOptions)
.then((text) => {
Expand All @@ -21,8 +22,7 @@ describe('Fetcher', function () {
.catch(done);
});
it('should fail [test checkResponse()]', (done) => {
const url = 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/' +
'noFile.txt';
const url = `${itownsdataUrl}/noFile.txt`;
let res;
Fetcher.text(url, networkOptions)
.then((text) => {
Expand All @@ -42,8 +42,7 @@ describe('Fetcher', function () {
});

describe('json', function () {
const url = 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/' +
'immersive/exampleParis1/cameraCalibration.json';
const url = `${itownsdataUrl}/immersive/exampleParis1/cameraCalibration.json`;
it('should load a json file', (done) => {
Fetcher.json(url, networkOptions)
.then((json) => {
Expand All @@ -56,8 +55,7 @@ describe('Fetcher', function () {
});

describe('xml', function () {
const url = 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/' +
'ULTRA2009.gpx';
const url = `${itownsdataUrl}/ULTRA2009.gpx`;
it('should load a xml file', (done) => {
Fetcher.xml(url, networkOptions)
.then((xml) => {
Expand Down Expand Up @@ -87,8 +85,7 @@ describe('Fetcher', function () {
});

describe('arrayBuffer', function () {
const url = 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/' +
'altitude-conversion-grids/RAF20_float.gtx';
const url = `${itownsdataUrl}/altitude-conversion-grids/RAF20_float.gtx`;
it('should load a json file', (done) => {
Fetcher.arrayBuffer(url, networkOptions)
.then((buffer) => {
Expand Down Expand Up @@ -126,8 +123,7 @@ describe('Fetcher', function () {
});

describe('multiple', function () {
const url = 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/' +
'vrt/velib-disponibilite-en-temps-reel';
const url = `${itownsdataUrl}/vrt/velib-disponibilite-en-temps-reel`;
const extension = {
xml: ['vrt'],
text: ['csv'],
Expand Down

0 comments on commit ba2226c

Please sign in to comment.