Skip to content

Commit 88b8094

Browse files
committed
Temporary unit test fix
1 parent 33c230f commit 88b8094

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/React.Tests/Core/JavaScriptEngineFactoryTest.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,25 @@
99

1010
using System.Threading;
1111
using JavaScriptEngineSwitcher.Core;
12+
using Moq;
1213
using NUnit.Framework;
1314

1415
namespace React.Tests.Core
1516
{
1617
[TestFixture]
1718
public class JavaScriptEngineFactoryTest
1819
{
20+
static JavaScriptEngineFactoryTest()
21+
{
22+
// TODO: Make this nicer
23+
JavaScriptEngineFactory.AddFactoryWithPriority(() =>
24+
{
25+
var mockJsEngine = new Mock<IJsEngine>();
26+
mockJsEngine.Setup(x => x.Evaluate<int>("1 + 1")).Returns(2);
27+
return mockJsEngine.Object;
28+
}, 1);
29+
}
30+
1931
[Test]
2032
public void ShouldCallOnNewEngineWhenCreatingNew()
2133
{

0 commit comments

Comments
 (0)