當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript test_support.makeTempDir函數代碼示例

本文整理匯總了TypeScript中@angular/tsc-wrapped/test/test_support.makeTempDir函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript makeTempDir函數的具體用法?TypeScript makeTempDir怎麽用?TypeScript makeTempDir使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了makeTempDir函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: beforeEach

 beforeEach(() => {
   basePath = makeTempDir();
   write = (fileName: string, content: string) => {
     fs.writeFileSync(path.join(basePath, fileName), content, {encoding: 'utf-8'});
   };
   write('tsconfig-base.json', `{
     "compilerOptions": {
       "experimentalDecorators": true,
       "types": [],
       "outDir": "built",
       "declaration": true,
       "module": "es2015",
       "moduleResolution": "node",
       "lib": ["es6", "dom"]
     }
   }`);
   outDir = path.resolve(basePath, 'built');
   const ngRootDir = getNgRootDir();
   const nodeModulesPath = path.resolve(basePath, 'node_modules');
   fs.mkdirSync(nodeModulesPath);
   fs.symlinkSync(
       path.resolve(ngRootDir, 'dist', 'all', '@angular'),
       path.resolve(nodeModulesPath, '@angular'));
   fs.symlinkSync(
       path.resolve(ngRootDir, 'node_modules', 'rxjs'), path.resolve(nodeModulesPath, 'rxjs'));
 });
開發者ID:rjamet,項目名稱:angular,代碼行數:26,代碼來源:main_spec.ts

示例2: beforeEach

 beforeEach(() => {
   errorSpy = jasmine.createSpy('consoleError');
   basePath = makeTempDir();
   write = (fileName: string, content: string) => {
     const dir = path.dirname(fileName);
     if (dir != '.') {
       const newDir = path.join(basePath, dir);
       if (!fs.existsSync(newDir)) fs.mkdirSync(newDir);
     }
     fs.writeFileSync(path.join(basePath, fileName), content, {encoding: 'utf-8'});
   };
   write('tsconfig-base.json', `{
     "compilerOptions": {
       "experimentalDecorators": true,
       "skipLibCheck": true,
       "types": [],
       "outDir": "built",
       "declaration": true,
       "module": "es2015",
       "moduleResolution": "node",
       "lib": ["es6", "dom"]
     }
   }`);
   outDir = path.resolve(basePath, 'built');
   const ngRootDir = getNgRootDir();
   const nodeModulesPath = path.resolve(basePath, 'node_modules');
   fs.mkdirSync(nodeModulesPath);
   fs.symlinkSync(
       path.resolve(ngRootDir, 'dist', 'all', '@angular'),
       path.resolve(nodeModulesPath, '@angular'));
   fs.symlinkSync(
       path.resolve(ngRootDir, 'node_modules', 'rxjs'), path.resolve(nodeModulesPath, 'rxjs'));
 });
開發者ID:DanielKucal,項目名稱:angular,代碼行數:33,代碼來源:ngc_spec.ts

示例3: beforeEach

 beforeEach(() => {
   basePath = makeTempDir();
   write = (fileName: string, content: string) => {
     fs.writeFileSync(path.join(basePath, fileName), content, {encoding: 'utf-8'});
   };
   write('tsconfig.json', `{
     "compilerOptions": {
       "experimentalDecorators": true,
       "types": [],
       "outDir": "built",
       "declaration": true,
       "module": "es2015"
     },
     "angularCompilerOptions": {
       "annotateForClosureCompiler": true
     },
     "files": ["test.ts"]
   }`);
 });
開發者ID:molcik,項目名稱:Angular,代碼行數:19,代碼來源:main_spec.ts

示例4: beforeEach

 beforeEach(() => {
   basePath = makeTempDir();
   write = (fileName: string, content: string) => {
     fs.writeFileSync(path.join(basePath, fileName), content, {encoding: 'utf-8'});
   };
   write('tsconfig.json', `{
     "compilerOptions": {
       "experimentalDecorators": true,
       "types": [],
       "outDir": "built",
       "declaration": true,
       "module": "es2015",
       "moduleResolution": "node"
     },
     "angularCompilerOptions": {
       "annotateForClosureCompiler": true
     },
     "files": ["test.ts"]
   }`);
   const nodeModulesPath = path.resolve(basePath, 'node_modules');
   fs.mkdirSync(nodeModulesPath);
   fs.symlinkSync(path.resolve(__dirname, '..', '..'), path.resolve(nodeModulesPath, '@angular'));
 });
開發者ID:wuxiangege,項目名稱:angular,代碼行數:23,代碼來源:main_spec.ts

示例5: beforeEach

 beforeEach(() => {
   errorSpy = jasmine.createSpy('consoleError').and.callFake(console.error);
   basePath = makeTempDir();
   write = (fileName: string, content: string) => {
     const dir = path.dirname(fileName);
     if (dir != '.') {
       const newDir = path.join(basePath, dir);
       if (!fs.existsSync(newDir)) fs.mkdirSync(newDir);
     }
     fs.writeFileSync(path.join(basePath, fileName), content, {encoding: 'utf-8'});
   };
   const ngRootDir = getNgRootDir();
   const nodeModulesPath = path.resolve(basePath, 'node_modules');
   fs.mkdirSync(nodeModulesPath);
   fs.symlinkSync(
       path.resolve(ngRootDir, 'dist', 'all', '@angular'),
       path.resolve(nodeModulesPath, '@angular'));
   fs.symlinkSync(
       path.resolve(ngRootDir, 'node_modules', 'rxjs'), path.resolve(nodeModulesPath, 'rxjs'));
   fs.symlinkSync(
       path.resolve(ngRootDir, 'node_modules', 'typescript'),
       path.resolve(nodeModulesPath, 'typescript'));
 });
開發者ID:MarkPieszak,項目名稱:angular,代碼行數:23,代碼來源:check_types_spec.ts


注:本文中的@angular/tsc-wrapped/test/test_support.makeTempDir函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。