-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic test and fix import issue with react server dom (#39)
- Loading branch information
Showing
5 changed files
with
30 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,6 @@ jobs: | |
|
||
- name: Build the project | ||
run: npm run build | ||
|
||
- name: Test the project | ||
run: npm run test |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import ReactDOMServer from "react-dom/server"; | ||
import ReactDOMServer from "react-dom/server.js"; | ||
export var renderToString = ReactDOMServer.renderToString; | ||
export var renderToStaticMarkup = ReactDOMServer.renderToStaticMarkup; |
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,6 @@ | ||
let conf = ./spago.dhall | ||
|
||
in conf // { | ||
sources = conf.sources # [ "test/**/*.purs" ], | ||
dependencies = conf.dependencies # [ "effect", "spec", "aff" ] | ||
} |
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,18 @@ | ||
module Test.Main where | ||
|
||
import Prelude | ||
|
||
import Effect (Effect) | ||
import Effect.Aff (launchAff_) | ||
import React.Basic.DOM.Server (renderToString) | ||
import Test.Spec (describe, it) | ||
import Test.Spec.Assertions (shouldEqual) | ||
import Test.Spec.Reporter.Console (consoleReporter) | ||
import Test.Spec.Runner (runSpec) | ||
|
||
main :: Effect Unit | ||
main = launchAff_ $ runSpec [consoleReporter] do | ||
describe "react-basic-dom-spec" do | ||
describe "react-basic-dom-server" do | ||
it "imports properly" do | ||
renderToString mempty `shouldEqual` "" |