Also use it to test the public API for core and common Once we have an ng_package for every package, we can remove the npm dependency on ts-api-guardian and the gulp-based public api check. PR Close #22544
		
			
				
	
	
		
			28 lines
		
	
	
		
			732 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			732 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /**
 | |
|  * @license
 | |
|  * Copyright Google Inc. All Rights Reserved.
 | |
|  *
 | |
|  * Use of this source code is governed by an MIT-style license that can be
 | |
|  * found in the LICENSE file at https://angular.io/license
 | |
|  */
 | |
| 
 | |
| import * as chai from 'chai';
 | |
| import * as fs from 'fs';
 | |
| import * as path from 'path';
 | |
| 
 | |
| export function unlinkRecursively(file: string) {
 | |
|   if (fs.statSync(file).isDirectory()) {
 | |
|     for (const f of fs.readdirSync(file)) {
 | |
|       unlinkRecursively(path.join(file, f));
 | |
|     }
 | |
|     fs.rmdirSync(file);
 | |
|   } else {
 | |
|     fs.unlinkSync(file);
 | |
|   }
 | |
| }
 | |
| 
 | |
| export function assertFileEqual(actualFile: string, expectedFile: string) {
 | |
|   chai.assert.equal(
 | |
|       fs.readFileSync(actualFile).toString(), fs.readFileSync(expectedFile).toString());
 | |
| }
 |