up testing engine

This commit is contained in:
Tykayn 2025-04-28 00:44:55 +02:00 committed by tykayn
parent 353fa37c85
commit 44a6d309a9
2 changed files with 24 additions and 19 deletions

View file

@ -7,6 +7,16 @@ const testingGeoJson = require('./data/testing.json')
// import { describe, expect, test } from '@jest/globals'
describe('mapping engine', () => {
test('load mapping config', () => {
let Mapping_engine = new MappingEngine(mappings.mappingSame)
expect(Mapping_engine.getConfig()).toStrictEqual(mappings.mappingSame)
})
})
describe('mapping properties with rich mapping engine', () => {
// test('do not add properties at all when there is nothing in tags of the mapping config', () => {
@ -22,14 +32,15 @@ describe('mapping properties with rich mapping engine', () => {
// expect(Object.keys(mapped_point.properties)).toStrictEqual([])
// })
// test('maps simple key to key, and keep the same value', () => {
// let Mapping_engine = new mapping_engine(mappingSame)
// let newProperties = Mapping_engine.convertProperty('equal',
// Object.keys(mappingSame.tags),
// feature_to_test,
// mappingSame.default_properties_of_point)
// let Mapping_engine = new MappingEngine(mappings.mappingSame)
// expect(newProperties).toStrictEqual({
// test('maps simple key to key, and keep the same value', () => {
// Mapping_engine.setConfig(mappings.mappingSame)
// let feature_to_test = testingGeoJson.features[0]
// let mapped_point = Mapping_engine.mapElementFromConf(feature_to_test)
// expect(mapped_point.properties).toStrictEqual({
// equal: "same value"
// })
// })