-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
- Loading branch information
Showing
94 changed files
with
374 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
es4x/src/test/java/io/reactiverse/es4x/test/CommonJSExportsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package io.reactiverse.es4x.test; | ||
|
||
import io.reactiverse.es4x.Runtime; | ||
import io.vertx.ext.unit.junit.RunTestOnContext; | ||
import io.vertx.ext.unit.junit.VertxUnitRunner; | ||
import org.graalvm.polyglot.Value; | ||
import org.junit.Before; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static io.reactiverse.es4x.test.JS.*; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
@RunWith(VertxUnitRunner.class) | ||
public class CommonJSExportsTest { | ||
|
||
private Runtime runtime; | ||
|
||
@Rule | ||
public RunTestOnContext rule = new RunTestOnContext(); | ||
|
||
@Before | ||
public void initialize() { | ||
runtime = commonjs(rule.vertx()); | ||
} | ||
|
||
@Test | ||
public void shouldAllowCustomizationOfExports() { | ||
require(runtime, "./lib/exports/index.js"); | ||
} | ||
|
||
@Test | ||
public void shouldAllowCustomizationOfExportsFromSubmodule() { | ||
require(runtime, "./lib/exports/exports.js"); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
es4x/src/test/java/io/reactiverse/es4x/test/CommonJs580Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.reactiverse.es4x.test; | ||
|
||
import io.reactiverse.es4x.Runtime; | ||
import io.vertx.ext.unit.junit.RunTestOnContext; | ||
import io.vertx.ext.unit.junit.VertxUnitRunner; | ||
import org.junit.Before; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static io.reactiverse.es4x.test.JS.*; | ||
|
||
@RunWith(VertxUnitRunner.class) | ||
public class CommonJs580Test { | ||
|
||
private Runtime runtime; | ||
|
||
@Rule | ||
public RunTestOnContext rule = new RunTestOnContext(); | ||
|
||
@Before | ||
public void initialize() { | ||
runtime = commonjs(rule.vertx()); | ||
} | ||
|
||
@Test | ||
public void shouldThrowAnErrorIfFileCantBeFound() { | ||
require(runtime, "./lib/580"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const someJson = require('some-dependency/some-directory/some-file.json') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require('./index') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", {value: true}); |
1 change: 1 addition & 0 deletions
1
es4x/src/test/resources/node_modules/some-dependency/some-directory/some-file.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.