Skip to content

Commit

Permalink
Refactor unit-tests (closes #28)
Browse files Browse the repository at this point in the history
  • Loading branch information
dokmic committed Jan 24, 2020
1 parent 5318a64 commit 1669d0c
Show file tree
Hide file tree
Showing 7 changed files with 324 additions and 286 deletions.
19 changes: 2 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,8 @@
"typescript": "^3.0"
},
"jest": {
"testEnvironment": "node",
"preset": "ts-jest",
"coverageDirectory": "./coverage",
"collectCoverage": true,
"moduleFileExtensions": [
"ts",
"js"
],
"transform": {
"^.+\\.ts$": "ts-jest"
},
"globals": {
"ts-jest": {
"tsConfigFile": "tsconfig.json"
}
},
"testMatch": [
"**/__tests__/*.+(ts)"
]
"collectCoverage": true
}
}
119 changes: 119 additions & 0 deletions src/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`transform should be transformed 1`] = `
Object {
"app_id": "angry-birds",
"br_features_flash": false,
"br_features_pdf": true,
"collector_tstamp": "2013-11-26T00:02:05Z",
"contexts_com_snowplowanalytics_snowplow_ua_parser_context_1": Array [
Object {
"deviceFamily": "Other",
"osFamily": "Windows XP",
"osMajor": null,
"osMinor": null,
"osPatch": null,
"osPatchMinor": null,
"osVersion": "Windows XP",
"useragentFamily": "IE",
"useragentMajor": "7",
"useragentMinor": "0",
"useragentPatch": null,
"useragentVersion": "IE 7.0",
},
],
"contexts_org_schema_web_page_1": Array [
Object {
"author": "Fred Blundun",
"breadcrumb": Array [
"blog",
"releases",
],
"datePublished": "2014-11-06T00:00:00Z",
"genre": "blog",
"inLanguage": "en-US",
"keywords": Array [
"snowplow",
"javascript",
"tracker",
"event",
],
},
],
"contexts_org_w3_performance_timing_1": Array [
Object {
"connectEnd": 1415358090183,
"connectStart": 1415358090103,
"domComplete": 0,
"domContentLoadedEventEnd": 1415358091309,
"domContentLoadedEventStart": 1415358090968,
"domInteractive": 1415358090886,
"domLoading": 1415358090270,
"domainLookupEnd": 1415358090102,
"domainLookupStart": 1415358090102,
"fetchStart": 1415358089870,
"loadEventEnd": 0,
"loadEventStart": 0,
"navigationStart": 1415358089861,
"redirectEnd": 0,
"redirectStart": 0,
"requestStart": 1415358090183,
"responseEnd": 1415358090265,
"responseStart": 1415358090265,
"unloadEventEnd": 1415358090287,
"unloadEventStart": 1415358090270,
},
],
"derived_tstamp": "2013-11-26T00:03:57.886Z",
"domain_sessionid": "2b15e5c8-d3b1-11e4-b9d6-1681e6b88ec1",
"domain_sessionidx": 3,
"domain_userid": "bc2e92ec6c204a14",
"dvce_created_tstamp": "2013-11-26T00:03:57.885Z",
"etl_tstamp": "2017-01-26T00:01:25.292Z",
"event": "page_view",
"event_fingerprint": "e3dbfa9cca0412c3d4052863cefb547f",
"event_format": "jsonschema",
"event_id": "c6ef3124-b53a-4b13-a233-0088f79dcbcb",
"event_name": "link_click",
"event_vendor": "com.snowplowanalytics.snowplow",
"event_version": "1-0-0",
"geo_city": "New York",
"geo_country": "US",
"geo_latitude": 37.443604,
"geo_location": "37.443604,-122.4124",
"geo_longitude": -122.4124,
"geo_region": "TX",
"geo_region_name": "Florida",
"geo_zipcode": "94109",
"ip_domain": "nuvox.net",
"ip_isp": "FDN Communications",
"ip_netspeed": "Cable/DSL",
"ip_organization": "Bouygues Telecom",
"name_tracker": "cloudfront-1",
"network_userid": "ecdff4d0-9175-40ac-a8bb-325c49733607",
"page_title": "On Analytics",
"page_url": "http://www.snowplowanalytics.com",
"page_urlfragment": "4-conclusion",
"page_urlhost": "www.snowplowanalytics.com",
"page_urlpath": "/product/index.html",
"page_urlport": 80,
"page_urlquery": "id=GTM-DLRG",
"page_urlscheme": "http",
"platform": "web",
"true_tstamp": "2013-11-26T00:03:57.886Z",
"txn_id": 41828,
"unstruct_event_com_snowplowanalytics_snowplow_link_click_1": Object {
"elementClasses": Array [
"foreground",
],
"elementId": "exampleLink",
"targetUrl": "http://www.example.com",
},
"user_fingerprint": "2161814971",
"user_id": "jon.doe@email.com",
"user_ipaddress": "92.231.54.234",
"v_collector": "clj-tomcat-0.1.0",
"v_etl": "serde-0.5.2",
"v_tracker": "js-2.1.0",
}
`;
100 changes: 0 additions & 100 deletions src/__tests__/types.test.ts

This file was deleted.

Loading

0 comments on commit 1669d0c

Please sign in to comment.