How to use the @nstudio/xplat/testing.isInModuleMetadata 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
'/apps/web-viewer/src/app/features/foo/components/foo/foo.component.html'
      )
    ).toBeGreaterThanOrEqual(-1);
    expect(
      files.indexOf(
        '/apps/web-viewer/src/app/features/foo/components/foo/foo.component.ts'
      )
    ).toBeGreaterThanOrEqual(-1);

    // file content
    let modulePath = '/xplat/nativescript/features/foo/foo.module.ts';
    let featureModule = getFileContent(tree, modulePath);
    // console.log(modulePath + ':');
    // console.log(featureModule);
    expect(featureModule).toMatch(
      isInModuleMetadata('FooModule', 'imports', `UIModule`, true)
    );
    expect(featureModule).toMatch(
      `import { UIModule } from \'../ui/ui.module\'`
    );

    modulePath = '/xplat/web/features/foo/foo.module.ts';
    featureModule = getFileContent(tree, modulePath);
    // console.log(modulePath + ':');
    // console.log(featureModule);
    expect(featureModule).toMatch(
      isInModuleMetadata('FooModule', 'imports', `UIModule`, true)
    );
    expect(featureModule).toMatch(
      `import { UIModule } from \'../ui/ui.module\'`
    );
  });
github nstudio / xplat / packages / nativescript-angular / src / schematics / application / index.spec.ts View on Github external
it('should create root NgModule with bootstrap information', async () => {
    const options = { ...defaultOptions };
    const tree = await runSchematic('app', options, appTree);
    const appModule = getFileContent(
      tree,
      '/apps/nativescript-foo/src/app.module.ts'
    );

    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'bootstrap', 'AppComponent', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'declarations', 'AppComponent', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'CoreModule', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'SharedModule', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'AppRoutingModule', true)
    );
    expect(appModule).toMatch("import { AppComponent } from './app.component'");
  });
github nstudio / xplat / packages / nativescript-angular / src / schematics / application / index.spec.ts View on Github external
it('should create root NgModule with bootstrap information', async () => {
    const options = { ...defaultOptions };
    const tree = await runSchematic('app', options, appTree);
    const appModule = getFileContent(
      tree,
      '/apps/nativescript-foo/src/app.module.ts'
    );

    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'bootstrap', 'AppComponent', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'declarations', 'AppComponent', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'CoreModule', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'SharedModule', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'AppRoutingModule', true)
    );
    expect(appModule).toMatch("import { AppComponent } from './app.component'");
  });
github nstudio / xplat / packages / nativescript-angular / src / schematics / application / index.spec.ts View on Github external
it('should create root NgModule with bootstrap information', async () => {
    const options = { ...defaultOptions };
    const tree = await runSchematic('app', options, appTree);
    const appModule = getFileContent(
      tree,
      '/apps/nativescript-foo/src/app.module.ts'
    );

    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'bootstrap', 'AppComponent', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'declarations', 'AppComponent', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'CoreModule', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'SharedModule', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'AppRoutingModule', true)
    );
    expect(appModule).toMatch("import { AppComponent } from './app.component'");
  });
github nstudio / xplat / packages / nativescript-angular / src / schematics / application / index.spec.ts View on Github external
);

    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'bootstrap', 'AppComponent', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'declarations', 'AppComponent', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'CoreModule', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'SharedModule', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'AppRoutingModule', true)
    );
    expect(appModule).toMatch("import { AppComponent } from './app.component'");
  });
github nstudio / xplat / packages / nativescript-angular / src / schematics / application / index.spec.ts View on Github external
const appModule = getFileContent(
      tree,
      '/apps/nativescript-foo/src/app.module.ts'
    );

    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'bootstrap', 'AppComponent', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'declarations', 'AppComponent', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'CoreModule', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'SharedModule', true)
    );
    expect(appModule).toMatch(
      isInModuleMetadata('AppModule', 'imports', 'AppRoutingModule', true)
    );
    expect(appModule).toMatch("import { AppComponent } from './app.component'");
  });
github nstudio / xplat / packages / nativescript-angular / src / schematics / application / index.spec.ts View on Github external
JSON.stringify({
        dependencies: {},
        devDependencies: {},
        xplat: {
          prefix: 'tt'
        }
      })
    );
    const tree = await runSchematic('app', options, appTree);
    const appModule = getFileContent(
      tree,
      '/apps/nativescript-foo/src/core/core.module.ts'
    );

    expect(appModule).toMatch(
      isInModuleMetadata(
        'CoreModule',
        'imports',
        `${stringUtils.classify(options.prefix)}CoreModule`,
        true
      )
    );
    expect(appModule).toMatch(
      `import { ${stringUtils.classify(options.prefix)}CoreModule } from \'@${
        options.npmScope
      }/nativescript-angular\'`
    );
  });