vendredi 24 juin 2016

How to get Mocha\Chai working with NativeScript iOS

I cannot seem to get {N} unit testing working on iOS...

1) Requires http with NSAllowsArbitraryLoads. Id rather not enable this, is there an exception to add that allows it just to be enabled for karma.

2) Error: Could not find module 'chai'. Computed path '/Users/steve/Library/Developer/CoreSimulato r/Devices/3607EE15-7B8D-46AE-9DE4-2526D5E91E1F/data/Containers/Bundle/Application/EBBB37FA-F126-499C-9B C1-D39179A0F58E/http://ift.tt/28SwZi9'.

This is all the test is

/// <reference path="../../typings/mocha/mocha.d.ts" />

import * as helpers from '../scripts/helpers';
import {assert} from 'chai'

describe('Hello World Sample Test:', function () {
    it('Counter should be 42 on start.', function () {
        assert.equal(42, 42); 
    });
});

So TypeScript shows no errors, chai is definatly in my node_modules, get all the intellisense goodness.

But indeed like the error says, it doesn't appear to be in that folder with all the other tns stuff (and my other plugins)?

Does anyone have this working or is it a bug?

Aucun commentaire:

Enregistrer un commentaire