File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ /*---------------------------------------------------------------------------------------------
2+ * Copyright (c) Microsoft Corporation. All rights reserved.
3+ * Licensed under the MIT License. See License.txt in the project root for license information.
4+ *--------------------------------------------------------------------------------------------*/
5+
6+ import { expect } from "chai" ;
7+ import { AbsolutePath } from "../../src/packageManager/AbsolutePath" ;
8+ import { TmpAsset , CreateTmpFile } from "../../src/CreateTmpAsset" ;
9+ import { join } from "path" ;
10+
11+ suite ( AbsolutePath . name , ( ) => {
12+ let tmpPath : TmpAsset ;
13+
14+ setup ( async ( ) => {
15+ tmpPath = await CreateTmpFile ( ) ;
16+ } ) ;
17+
18+ teardown ( ( ) => {
19+ tmpPath . dispose ( ) ;
20+ } ) ;
21+
22+ test ( 'Throws error when the passed value is not an absolute path' , ( ) => {
23+ expect ( ( ) => new AbsolutePath ( "somePath" ) ) . to . throw ( Error ) ;
24+ } ) ;
25+
26+ test ( `${ AbsolutePath . getAbsolutePath . name } : Returns an absolute path based by resolving the path with the value to prepend` , ( ) => {
27+ let absolutePath = AbsolutePath . getAbsolutePath ( tmpPath . name , "somePath" ) ;
28+ expect ( absolutePath . value ) . to . be . equal ( join ( tmpPath . name , "somePath" ) ) ;
29+ } ) ;
30+ } ) ;
You can’t perform that action at this time.
0 commit comments