xxxxxxxxxx
Use this extention in vs code
https://marketplace.visualstudio.com/items?itemName=adrianwilczynski.csharp-to-typescript
xxxxxxxxxx
function executeDotnetTest(testDirectoryPath: string, dotnetTestOptions: string): Promise<string> {
return new Promise((resolve, reject) => {
const command = `dotnet test -t -v=q${dotnetTestOptions}`;
Logger.Log(`Executing ${command} in ${testDirectoryPath}`);
Executor.exec(command, (err: Error, stdout: string, stderr: string) => {
if (err) {
Logger.LogError(`Error while executing ${command}`, stdout);
reject(err);
return;
}
resolve(stdout);
}, testDirectoryPath);
});
}
xxxxxxxxxx
interface User {
name: string;
id: number;
}
const user: User = {
username: "Hayes",
Type '{ username: string; id: number; }' is not assignable to type 'User'.
Object literal may only specify known properties, and 'username' does not exist in type 'User'.
id: 0,
};