Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test case for issue #160 #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,23 @@ public async void InvokeFromFileAsync_WithoutTypeParameter_IsThreadSafe()
Assert.Equal(numThreads, result);
}

// See: https://github.com/JeringTech/Javascript.NodeJS/issues/160
[Fact(Timeout = TIMEOUT_MS)]
public async void InvokeFromFileAsync_WorksForSingleFunctionExportEcmaScriptModule_Issue160()
{
for (int i = 0; i < 100; i++)
{
// Arrange
HttpNodeJSService testSubject = CreateHttpNodeJSService(projectPath: _projectPath);

for (int n = 0; n < 15; n++)
{
// Act
await testSubject.InvokeFromFileAsync<int>(DUMMY_SINGLE_FUNCTION_EXPORT_ECMA_SCRIPT_MODULE_FILE, args: new object[] {1, 2});
}
}
}

// WARNING: will fail randomly in Debug configuration if Node.js version is pre 19.0.0 - https://github.com/JeringTech/Javascript.NodeJS/issues/151#issuecomment-1396258748
[Fact(Timeout = TIMEOUT_MS)]
public async void InvokeFromFileAsync_WorksForSingleFunctionExportEcmaScriptModule()
Expand Down Expand Up @@ -216,7 +233,7 @@ public async void InvokeFromFileAsync_WorksForMultipleFunctionExportEcmaScriptMo
Assert.Equal(-1, result1);
Assert.Equal(3, result2);
}

[Fact(Timeout = TIMEOUT_MS)]
public async void InvokeFromFileAsync_ResActionShouldReturnHeadersAndContentInResponseMessage()
{
Expand Down