Пример #1
0
  test('scans properties', async () => {
    const namespaces = await getNamespaces('namespace-properties.js');
    assert.equal(namespaces.length, 1);

    assert.equal(namespaces[0].name, 'PropertiesNamespace');
    assert.equal(namespaces[0].description, '');
    assert.deepEqual(namespaces[0].warnings, []);
    assert.deepEqual(getProperties(namespaces[0]), [
      {
        name: 'property',
        description: undefined,
        privacy: 'public',
        readOnly: false,
        type: 'string',
        warnings: []
      },
      {
        name: 'propertyWithAnnotation',
        description: 'Property with annotation',
        privacy: 'public',
        readOnly: false,
        type: '(string | number)',
        warnings: []
      },
      {
        name: 'propertyWithReadOnly',
        description: undefined,
        privacy: 'public',
        readOnly: true,
        type: 'string',
        warnings: []
      },
      {
        name: 'propertyWithGetter',
        description: undefined,
        privacy: 'public',
        readOnly: true,
        type: undefined,
        warnings: []
      },
      {
        name: 'propertyWithGetterSetter',
        description: undefined,
        privacy: 'public',
        readOnly: false,
        type: undefined,
        warnings: []
      },
      {
        name: 'propertyWithSetterFirst',
        description: undefined,
        privacy: 'public',
        readOnly: false,
        type: undefined,
        warnings: []
      },
      {
        name: 'propertyDefinedLater',
        description: undefined,
        privacy: 'public',
        readOnly: false,
        type: 'string',
        warnings: []
      },
      {
        name: 'propertyDefinedLaterWithAnnotation',
        description: 'Test property',
        privacy: 'public',
        readOnly: false,
        type: 'boolean',
        warnings: []
      },
      {
        name: 'propertyDefinedLaterWithoutValue',
        description: undefined,
        privacy: 'public',
        readOnly: false,
        type: 'string',
        warnings: []
      }
    ]);
  });
Пример #2
0
			return helpers.executeActionByChunks(initialData, chunkSize, (element: number, index: number) => {
				handledElements.push(element);
				assert.deepEqual(element, initialData[index]);
				assert.isTrue(initialData.indexOf(element) !== -1);
				return assertElements(initialData, handledElements, element, chunkSize);
			});
Пример #3
0
 it('should center on y', function() {
   assert.deepEqual(props.y, { value: 10.5 });
 });
Пример #4
0
		const assertPidTestData = (testData: IiOSSimulatorPidTestData) => {
			const actualResult = helpers.getPidFromiOSSimulatorLogs(testData.appId || appId, testData.input);
			assert.deepEqual(actualResult, testData.expectedResult, `For input ${testData.input}, the expected result is: ${testData.expectedResult}, but actual result is: ${actualResult}.`);
		};
Пример #5
0
			_.each(testData, testCase => {
				assert.deepEqual(helpers.appendZeroesToVersion(testCase.input, testCase.requiredVersionLength), testCase.expectedResult);
			});
Пример #6
0
		it("returns false when Object.create(null) is passed", () => {
			const actualResult = helpers.toBoolean(Object.create(null));
			assert.deepEqual(actualResult, false);
		});
Пример #7
0
				.then(res => {
					assert.deepEqual(res, testData.expectedResult);
				}, err => {
Пример #8
0
 it('should correctly parse an encoding query given a fieldDefShorthand with timeunit function', () => {
   const encQ = shorthandParser.fn('hours(a,t)');
   assert.deepEqual(encQ, {field: 'a', timeUnit: TimeUnit.HOURS, type: Type.TEMPORAL});
 });
Пример #9
0
 it('should correctly parse an encoding query from fieldDef parts', () => {
   let encQ = shorthandParser.rawFieldDef(
     splitWithTail('a,q,scale={"domain":[1,2],"exponent":3,"type":"pow"},axis={"orient":"top"}', ',', 2)
   );
   assert.deepEqual(encQ, {axis: {orient: 'top'}, field: 'a', scale: {domain: [1, 2], exponent: 3, type: ScaleType.POW}, type: Type.QUANTITATIVE});
 });
Пример #10
0
 it('should correctly parse an encoding query given a fieldDefShorthand with aggregation function', () => {
   const encQ = shorthandParser.fn('sum(horsepower,q)');
   assert.deepEqual(encQ, {aggregate: 'sum', field: 'horsepower', type: Type.QUANTITATIVE});
 });