@@ -5,6 +5,7 @@ import { test } from 'uvu';
5
5
import * as assert from 'uvu/assert' ;
6
6
import * as MakeNSIS from '../src/makensis' ;
7
7
import path from 'node:path' ;
8
+ import type Makensis from '../types' ;
8
9
9
10
const scriptFile = {
10
11
minimal : path . join ( process . cwd ( ) , 'tests' , 'fixtures' , 'utf8.nsi' ) ,
@@ -77,17 +78,17 @@ test('Print compiler information', async () => {
77
78
} ) ;
78
79
79
80
test ( 'Print compiler information as JSON' , async ( ) => {
80
- const actual = ( await MakeNSIS . headerInfo ( { json : true } ) ) . stdout ? .defined_symbols . __GLOBAL__ ;
81
+ const actual = ( ( await MakeNSIS . headerInfo ( { json : true } ) ) . stdout as Makensis . HeaderInfo ) . defined_symbols . __GLOBAL__ ;
81
82
const expected = true ;
82
83
83
84
assert . is ( actual , expected ) ;
84
85
} ) ;
85
86
86
87
test ( 'Print help for all commands' , async ( ) => {
87
- const output = await MakeNSIS . commandHelp ( ) ;
88
+ const { stdout } = await MakeNSIS . commandHelp ( ) as { stdout : string } ;
88
89
89
90
const expected = shared . commandHelp ?. replace ( / \s + / g, '' ) ;
90
- const actual = output . stdout . replace ( / \s + / g, '' ) ;
91
+ const actual = stdout . replace ( / \s + / g, '' ) ;
91
92
92
93
assert . is ( actual , expected ) ;
93
94
} ) ;
@@ -245,7 +246,7 @@ test('Strict compilation with warning', async () => {
245
246
246
247
test ( 'Print ${NSISDIR}' , async ( ) => {
247
248
try {
248
- const nsisDir = await MakeNSIS . nsisDir ( ) ;
249
+ const nsisDir = await MakeNSIS . nsisDir ( ) as string ;
249
250
const nsisCfg = path . join ( nsisDir , 'Include' , 'MUI2.nsh' ) ;
250
251
251
252
const expected = true ;
@@ -259,8 +260,8 @@ test('Print ${NSISDIR}', async () => {
259
260
260
261
test ( 'Print ${NSISDIR} as JSON' , async ( ) => {
261
262
try {
262
- const nsisDir = await MakeNSIS . nsisDir ( { json : true } ) ;
263
- const nsisCfg = path . join ( nsisDir . nsisdir , 'Include' , 'MUI2.nsh' ) ;
263
+ const { nsisdir } = await MakeNSIS . nsisDir ( { json : true } ) as unknown as { nsisdir : string } ;
264
+ const nsisCfg = path . join ( nsisdir , 'Include' , 'MUI2.nsh' ) ;
264
265
265
266
const expected = true ;
266
267
const actual = existsSync ( nsisCfg ) ;
0 commit comments