Skip to content

Commit

Permalink
run ns test init
Browse files Browse the repository at this point in the history
  • Loading branch information
matey97 committed May 4, 2022
1 parent bb310e6 commit 4bbe9ab
Show file tree
Hide file tree
Showing 21 changed files with 1,685 additions and 86 deletions.
11 changes: 11 additions & 0 deletions demo/app/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { runTestApp } from "@nativescript/unit-test-runner";
// import other polyfills here

declare let require: any;

runTestApp({
runTests: () => {
const tests = require.context("./tests", true, /\.spec\.ts$/);
tests.keys().map(tests);
},
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { wearOS, WearOsNode } from "nativescript-wearos-sensors/internal/utils/android/wear-os-types.android";
import { CapabilityDiscoverer } from "nativescript-wearos-sensors/internal/capability-discoverer.android";
import { buildFakeNode } from ".";
import { buildFakeNode } from "~/tests/internal/index.spec";

const SUPPORTED_CAPABILITY = "supportedCapability";
const UNSUPPORTED_CAPABILITY = "unsupportedCapability";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Node } from "nativescript-wearos-sensors/internal/node";
import { SensorType } from "nativescript-wearos-sensors/internal/sensors/sensor-type";
import { MessagingClient } from "nativescript-wearos-sensors/internal/communication/messaging/messaging-client";
import { CollectorManagerImpl } from "nativescript-wearos-sensors/internal/collection/collector-manager-impl.android";
import { buildFakeResolutionResult } from ".";
import { buildFakeResolutionResult } from "~/tests/internal/index.spec";

describe("Collector manager implementation", () => {
const node1 = new Node("node1", "node1", [SensorType.ACCELEROMETER, SensorType.GYROSCOPE]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Node } from "nativescript-wearos-sensors/internal/node";
import { SensorType } from "nativescript-wearos-sensors/internal/sensors/sensor-type";
import {CapabilityAdvertiserResultService} from "nativescript-wearos-sensors/internal/communication/capabilities/android/capability-advertiser-result-service.android";
import {buildFakeMessageEvent} from "~/tests/internal";
import {buildFakeMessageEvent} from "~/tests/internal/index.spec";

describe("Capability advertiser result service", () => {
const node = new Node("node1", "node1", []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Node } from "nativescript-wearos-sensors/internal/node";
import { SensorType } from "nativescript-wearos-sensors/internal/sensors/sensor-type";
import { CapabilityClient } from "nativescript-wearos-sensors/internal/communication/capabilities/android/capability-client.android";
import { CapabilityAdvertiserResultService } from "nativescript-wearos-sensors/internal/communication/capabilities/android/capability-advertiser-result-service.android";
import { buildFakeMessageEvent } from "~/tests/internal";
import { buildFakeMessageEvent } from "~/tests/internal/index.spec";

describe("Capability client", () => {
const node = new Node("node1", "node1", []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
buildFakeMessageEvent,
buildFakeResolutionResult,
getFakeMessagingProtocol
} from "~/tests/internal";
} from "~/tests/internal/index.spec";
import { Node } from "nativescript-wearos-sensors/internal/node";
import { MessagingResultService } from "nativescript-wearos-sensors/internal/communication/messaging/android/messaging-result-service.android";
import { MessagingClientImpl } from "nativescript-wearos-sensors/internal/communication/messaging/android/messaging-client.android";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ResultMessagingProtocol } from "nativescript-wearos-sensors/internal/communication/messaging";
import { buildFakeMessageEvent, buildFakeResolutionResult } from "../../../index";
import { buildFakeMessageEvent, buildFakeResolutionResult } from "../../../index.spec";
import { MessagingResultService } from "nativescript-wearos-sensors/internal/communication/messaging/android/messaging-result-service.android";

describe("Result Messaging Service", () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CapabilityClient } from "nativescript-wearos-sensors/internal/communica
import { Node } from "nativescript-wearos-sensors/internal/node";
import { CapabilityAdvertisementResult } from "nativescript-wearos-sensors/internal/communication/capabilities/android/capability-advertiser-result-service.android";
import { AndroidNodeDiscoverer } from "nativescript-wearos-sensors/internal/node/discoverer/node-discoverer.android";
import { buildFakeNode } from "~/tests/internal";
import { buildFakeNode } from "~/tests/internal/index.spec";
import { SensorType } from "nativescript-wearos-sensors/internal/sensors/sensor-type";
import { toArray, isEmpty } from "rxjs/operators";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SensorCallbackManager } from "nativescript-wearos-sensors/internal/sensor-callback-manager";
import { SensorRecord, SensorRecords } from "nativescript-wearos-sensors/internal/sensors/sensor-record";
import { buildFakeSensorRecords } from "~/tests/internal/index";
import { buildFakeSensorRecords } from "~/tests/internal/index.spec";
import { SensorType } from "nativescript-wearos-sensors/internal/sensors/sensor-type";

describe("Sensor callback manager", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildFakeMessageEvent, getFakeMessagingProtocol } from "~/tests/internal";
import { buildFakeMessageEvent, getFakeMessagingProtocol } from "~/tests/internal/index.spec";
import { HeartRateRecordMessagingService } from "nativescript-wearos-sensors/internal/sensors/heart-rate/android/record-messaging-service.android";
import { HeartRateSensorRecord } from "nativescript-wearos-sensors/internal/sensors/heart-rate/record";
import { SensorType } from "nativescript-wearos-sensors/internal/sensors/sensor-type";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildFakeMessageEvent, getFakeMessagingProtocol } from "~/tests/internal";
import { buildFakeMessageEvent, getFakeMessagingProtocol } from "~/tests/internal/index.spec";
import { LocationSensorRecord } from "nativescript-wearos-sensors/internal/sensors/location/record";
import { LocationRecordMessagingService } from "nativescript-wearos-sensors/internal/sensors/location/android/record-messaging-service.android";
import { SensorType } from "nativescript-wearos-sensors/internal/sensors/sensor-type";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AccelerometerRecordMessagingService } from "nativescript-wearos-sensors/internal/sensors/triaxial/accelerometer/android/record-messaging-service.android";
import { buildFakeEncodedMessage, getFakeTriAxialData } from "../../index";
import { buildFakeMessageEvent, getFakeMessagingProtocol } from "~/tests/internal";
import { buildFakeEncodedMessage, getFakeTriAxialData } from "../../index.spec";
import { buildFakeMessageEvent, getFakeMessagingProtocol } from "~/tests/internal/index.spec";
import { TriAxialSensorRecord } from "nativescript-wearos-sensors/internal/sensors/triaxial/record";
import { SensorType } from "nativescript-wearos-sensors/internal/sensors/sensor-type";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { buildFakeMessageEvent, getFakeMessagingProtocol } from "~/tests/internal";
import { buildFakeEncodedMessage, getFakeTriAxialData } from "~/tests/internal/sensors/triaxial";
import { buildFakeMessageEvent, getFakeMessagingProtocol } from "~/tests/internal/index.spec";
import { buildFakeEncodedMessage, getFakeTriAxialData } from "~/tests/internal/sensors/triaxial/index.spec";
import { GyroscopeRecordMessagingService } from "nativescript-wearos-sensors/internal/sensors/triaxial/gyroscope/android/record-messaging-service.android";
import { TriAxialSensorRecord } from "nativescript-wearos-sensors/internal/sensors/triaxial/record";
import { SensorType } from "nativescript-wearos-sensors/internal/sensors/sensor-type";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { buildFakeMessageEvent, getFakeMessagingProtocol } from "~/tests/internal";
import { buildFakeEncodedMessage, getFakeTriAxialData } from "~/tests/internal/sensors/triaxial";
import { buildFakeMessageEvent, getFakeMessagingProtocol } from "~/tests/internal/index.spec";
import { buildFakeEncodedMessage, getFakeTriAxialData } from "~/tests/internal/sensors/triaxial/index.spec";
import { MagnetometerRecordMessagingService } from "nativescript-wearos-sensors/internal/sensors/triaxial/magnetometer/android/record-messaging-service.android";
import { TriAxialSensorRecord } from "nativescript-wearos-sensors/internal/sensors/triaxial/record";
import { SensorType } from "nativescript-wearos-sensors/internal/sensors/sensor-type";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { buildFakeMessageEvent, getFakeMessagingProtocol } from "../../index";
import { buildFakeMessageEvent, getFakeMessagingProtocol } from "../../index.spec";
import { TriAxialRecordMessagingService } from "nativescript-wearos-sensors/internal/sensors/triaxial/triaxial-record-messaging-service.android";
import { TriAxialSensorRecord } from "nativescript-wearos-sensors/internal/sensors/triaxial/record";
import { buildFakeEncodedMessage, getFakeTriAxialData } from ".";
import { buildFakeEncodedMessage, getFakeTriAxialData } from "~/tests/internal/sensors/triaxial/index.spec";

describe("TriAxial record messaging service", () => {
const nodeId = "testNode";
Expand Down
Loading

0 comments on commit 4bbe9ab

Please sign in to comment.