import * as assert from 'assert' ; import { createTestActionContext } from 'vscode-azureextensiondev' ; import { FuncVersion , hasMinFuncCliVersion } from '../extension.bundle' ; suite ( 'hasMinFuncCliVersion' , ( ) => { test ( 'Smaller major version' , async ( ) => { const result = await hasMinFuncCliVersion ( await createTestActionContext ( ) , '2.0.3' , FuncVersion . v1 ) ; assert . strictEqual ( result , false ) ; } ) ; test ( 'Greater major version' , async ( ) => { const result = await hasMinFuncCliVersion ( await createTestActionContext ( ) , '2.0.3' , FuncVersion . v3 ) ; assert . strictEqual ( result , true ) ; } ) ; test ( 'Same major version, meets minimum' , async ( ) => { const result = await hasMinFuncCliVersion ( await createTestActionContext ( ) , '3.0.0' , FuncVersion . v3 ) ; assert . strictEqual ( result , true ) ; } ) ; test ( 'Same major version, doesn\'t meet minimum' , async ( ) => { const result = await hasMinFuncCliVersion ( await createTestActionContext ( ) , '3.9999.0' , FuncVersion . v3 ) ; assert . strictEqual ( result , false ) ; } ) ; } ) ;