tileserver-gl/test/setup.js
Martin d'Allens 526766c8f4
Extract nested functions and simplify a little (#1062)
* chore: make sure error exit codes of tests are returned

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: replace the last 'var' with 'const'

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: extract duplicated font listing

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: extract rendering functions to a new file

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: move nested respondImage() function to top level

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: simplify respondImage() args

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: fix typo in rendeAttribution

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

---------

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
2023-11-23 10:11:53 -05:00

29 lines
609 B
JavaScript

process.env.NODE_ENV = 'test';
import { expect } from 'chai';
import supertest from 'supertest';
import { server } from '../src/server.js';
global.expect = expect;
global.supertest = supertest;
before(function () {
console.log('global setup');
process.chdir('test_data');
const running = server({
configPath: 'config.json',
port: 8888,
publicUrl: '/test/',
});
global.app = running.app;
global.server = running.server;
return running.startupPromise;
});
after(function () {
console.log('global teardown');
global.server.close(function () {
console.log('Done');
});
});