How to use @here/harp-test-utils - 3 common examples

To help you get started, we’ve selected a few @here/harp-test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heremaps / harp.gl / test / rendering / GeoJsonDataRendering.ts View on Github external
async function geoJsonTest(options: GeoJsoTestOptions) {
        const ibct = new RenderingTestHelper(options.mochaTest, { module: "mapview" });
        const canvas = document.createElement("canvas");
        canvas.width = 400;
        canvas.height = 300;

        mapView = new MapView({
            canvas,
            theme: options.theme,
            preserveDrawingBuffer: true,
            pixelRatio: 1
        });

        const defaultLookAt: LookAtParams = {
            latitute: 53.3,
            longitude: 14.6,
            distance: 200000,
            tilt: 0,
github heremaps / harp.gl / test / rendering / GeoJsonDataRendering.ts View on Github external
const geoJsonDataSource = new OmvDataSource({
            decoder: new OmvTileDecoder(),
            dataProvider: new GeoJsonDataProvider(
                "geojson",
                typeof options.geoJson === "string"
                    ? new URL(options.geoJson, window.location.href)
                    : options.geoJson,
                { tiler: new GeoJsonTiler() }
            ),
            name: "geojson",
            styleSetName: "geojson"
        });

        mapView.addDataSource(geoJsonDataSource);

        await waitForEvent(mapView, MapViewEventNames.FrameComplete);

        await ibct.assertCanvasMatchesReference(canvas, options.testImageName);
    }
github heremaps / harp.gl / @here / harp-mapview-decoder / lib / TestDataProviders.ts View on Github external
async getTile(_tileKey: TileKey, _abortSignal?: AbortSignal): Promise {
        return loadTestResource(this.moduleName, this.basePath, "arraybuffer");
    }
}

@here/harp-test-utils

Provides utilities for tests

Apache-2.0
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis

Similar packages