How to use the @nstudio/xplat/testing.createXplatWithNativeScriptWeb function in @nstudio/xplat

To help you get started, we’ve selected a few @nstudio/xplat 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 nstudio / xplat / packages / angular / src / schematics / feature / index.spec.ts View on Github external
it('should create feature module (with dashes in name) for specified projects WITH Routing', async () => {
    appTree = Tree.empty();
    appTree = createXplatWithNativeScriptWeb(appTree, true);
    const options: XplatFeatureHelpers.Schema = { ...defaultOptions };
    // console.log('appTree:', appTree);
    options.onlyProject = true;
    options.routing = true;
    options.name = 'foo-with-dash';
    let tree = await runSchematic('feature', options, appTree);
    const files = tree.files;
    // console.log(files.slice(85,files.length));

    // feature should not be in shared code
    expect(files.indexOf('/libs/features/foo-with-dash/index.ts')).toBe(-1);
    expect(
      files.indexOf('/xplat/nativescript/features/foo-with-dash/index.ts')
    ).toBe(-1);
    expect(files.indexOf('/xplat/web/features/foo-with-dash/index.ts')).toBe(
      -1
github nstudio / xplat / packages / xplat / src / schematics / component / index.spec.ts View on Github external
it('should create component for specified platforms with framework name when no default is set', async () => {
    appTree = Tree.empty();
    appTree = createXplatWithNativeScriptWeb(appTree);
    // console.log('appTree:', appTree);
    let tree = await runSchematic(
      'feature',
      {
        name: 'foo',
        platforms: 'nativescript,web',
        isTesting: true
      },
      appTree
    );
    const options: XplatComponentHelpers.Schema = { ...defaultOptions };
    delete options.framework;
    tree = await runSchematic('component', options, tree);
    const files = tree.files;
    // console.log(files);//.slice(91,files.length));
github nstudio / xplat / packages / angular / src / schematics / component / index.spec.ts View on Github external
it('should create component for specified platforms with framework name when no default is set', async () => {
    appTree = Tree.empty();
    appTree = createXplatWithNativeScriptWeb(appTree);
    // console.log('appTree:', appTree);
    let tree = await runSchematic(
      'feature',
      {
        name: 'foo',
        platforms: 'nativescript,web'
      },
      appTree
    );
    const options: XplatComponentHelpers.Schema = { ...defaultOptions };
    tree = await runSchematic('component', options, tree);
    const files = tree.files;
    // console.log(files);//.slice(91,files.length));

    // component
    expect(
github nstudio / xplat / packages / angular / src / schematics / feature / index.spec.ts View on Github external
it('should create feature module with a single starting component with framework suffix for xplat when no default is set', async () => {
    appTree = Tree.empty();
    appTree = createXplatWithNativeScriptWeb(appTree);
    const options: XplatFeatureHelpers.Schema = { ...defaultOptions };
    // console.log('appTree:', appTree);
    let tree = await runSchematic('feature', options, appTree);
    const files = tree.files;
    // console.log(files.slice(85,files.length));
    expect(
      files.indexOf('/apps/nativescript-viewer/package.json')
    ).toBeGreaterThanOrEqual(0);
    expect(
      files.indexOf('/apps/web-viewer/src/app/features/core/core.module.ts')
    ).toBeGreaterThanOrEqual(0);

    // shared code defaults
    expect(files.indexOf('/libs/features/index.ts')).toBeGreaterThanOrEqual(0);
    expect(
      files.indexOf('/xplat/nativescript-angular/index.ts')
github nstudio / xplat / packages / angular / src / schematics / feature / index.spec.ts View on Github external
it('should create feature module for specified project WITH Routing and adjustSandbox', async () => {
    const options: XplatFeatureHelpers.Schema = {
      ...defaultOptions,
      projects: 'nativescript-viewer'
    };
    appTree = Tree.empty();
    appTree = createXplatWithNativeScriptWeb(appTree, true);

    // manually update home.component to prep for sandobx
    const homeCmpPath = `/apps/nativescript-viewer/src/features/home/components/home.component.html`;
    createOrUpdate(appTree, homeCmpPath, sandboxHomeSetup());
    // console.log('homecmp:', getFileContent(tree, homeCmpPath));

    options.onlyProject = true;
    options.adjustSandbox = true;
    options.routing = true;
    options.name = 'foo-with-dash';
    let tree = await runSchematic('feature', options, appTree);
    // console.log('---------')
    // console.log('homecmp:', getFileContent(tree, homeCmpPath));
  });
});
github nstudio / xplat / packages / angular / src / schematics / service / index.spec.ts View on Github external
beforeEach(() => {
    appTree = Tree.empty();
    appTree = createXplatWithNativeScriptWeb(appTree, null, 'angular');
  });
github nstudio / xplat / packages / nativescript / src / schematics / helpers / index.spec.ts View on Github external
beforeEach(() => {
    appTree = Tree.empty();
    appTree = createXplatWithNativeScriptWeb(appTree);
  });
github nstudio / xplat / packages / angular / src / schematics / feature / index.spec.ts View on Github external
beforeEach(() => {
    appTree = Tree.empty();
    appTree = createXplatWithNativeScriptWeb(appTree, null, 'angular');
  });
github nstudio / xplat / packages / xplat / src / schematics / component / index.spec.ts View on Github external
beforeEach(() => {
    appTree = Tree.empty();
    appTree = createXplatWithNativeScriptWeb(appTree, false, 'angular');
  });
github nstudio / xplat / packages / angular / src / schematics / component / index.spec.ts View on Github external
beforeEach(() => {
    appTree = Tree.empty();
    appTree = createXplatWithNativeScriptWeb(appTree, false, 'angular');
  });