Skip to content

Commit

Permalink
add setter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DurstDog87 committed Dec 27, 2023
1 parent 1d90fb9 commit 0757b40
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/__tests__/tileServer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { describe, expect, test } from '@jest/globals';
import { Pool } from 'pg';
import { Tileserver } from '../index';

const gPool = new Pool();

describe('test Tileserver class internals', () => {
test('constructor', () => {
const testClass = new Tileserver(gPool);
expect(testClass.srid).toStrictEqual(4269);
expect(testClass.extent).toStrictEqual(4096);
expect(testClass.buffer).toStrictEqual(256);
expect(testClass.clip_geom).toBe(true);
expect(!!testClass.queryString).toBe(false);
expect(testClass.queryString).toBe('');
});

test('setters', () => {
const testClass = new Tileserver(gPool);
testClass.setQuery('SELECT * FROM foo.bar;');
testClass.setSrid(4326);
expect(testClass.queryString).toBe('SELECT * FROM foo.bar;');
expect(testClass.srid).toBe(4326);
});
});

0 comments on commit 0757b40

Please sign in to comment.