SAP Spartacus B2B Organization unit 单元测试 b2b-user.selector.spec.ts launcher

// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'zone.js/dist/zone';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting,
} from '@angular/platform-browser-dynamic/testing';

declare const require: {
  context(
    path: string,
    deep?: boolean,
    filter?: RegExp
  ): {
    keys(): string[];
    <T>(id: string): T;
  };
};

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting()
);
// Then we find all the tests.


const context = require.context('./', true, /\.spec\.ts$/);

/*
// And load the modules.
context
  .keys()
  // filter tests from node_modules
  .filter((key) => !key.startsWith('@'))
  .forEach(context);
  */

  /*
  C:\Code\SPA\spartacus\feature-libs\organization\administration\core\store\selectors\b2b-user.selector.spec.ts

C:\Code\SPA\spartacus\feature-libs\organization\test.ts
*/
 const FILE = ['./administration/core/store/selectors/b2b-user.selector.spec.ts'];

 context.keys().filter( (name) => {
   console.log('name: ' + name);
   return !!FILE.includes(name)
 }).map(context);
上一篇:redis自动化监控


下一篇:带你回顾线程一生