File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change 44 *--------------------------------------------------------------------------------------------*/
55
66import { isValidDownload } from "../../../src/packageManager/isValidDownload" ;
7- import { createTestFile } from "../testAssets/TestFile" ;
8- import TestZip from "../testAssets/TestZip" ;
97import * as chai from "chai" ;
108
119chai . should ( ) ;
1210const expect = chai . expect ;
1311
1412suite ( `${ isValidDownload . name } ` , ( ) => {
15- const files = [
16- createTestFile ( "file1" , "file1.txt" ) ,
17- createTestFile ( "file2" , "file2.txt" )
18- ] ;
19-
20- let testZip : TestZip ;
21-
22- setup ( async ( ) => {
23- testZip = await TestZip . createTestZipAsync ( ...files ) ;
24- } ) ;
13+ const sampleBuffer = Buffer . from ( "sampleBuffer" ) ;
14+ const validIntegrity = "eb7201b5d986919e0ac67c820886358869d8f7059193d33c902ad7fe1688e1e9" ;
2515
2616 test ( 'Returns false for non-matching integrity' , async ( ) => {
27- let result = await isValidDownload ( testZip . buffer , "inValidIntegrity" ) ;
17+ let result = await isValidDownload ( sampleBuffer , "inValidIntegrity" ) ;
2818 expect ( result ) . to . be . false ;
2919 } ) ;
3020
3121 test ( 'Returns true for matching integrity' , async ( ) => {
32- let result = await isValidDownload ( testZip . buffer , "212785b9cf15888785ed55a9357b4c4e29d0acca6a978ccb1df7cc8ee7423071" ) ;
22+ let result = await isValidDownload ( sampleBuffer , validIntegrity ) ;
3323 expect ( result ) . to . be . true ;
3424 } ) ;
3525} ) ;
You can’t perform that action at this time.
0 commit comments