Skip to content

Add basic test and fix import issue with react server dom #39

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

Merged
merged 1 commit into from
Jun 18, 2022
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ jobs:

- name: Build the project
run: npm run build

- name: Test the project
run: npm run test
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"build": "run-s build:*",
"build:spago": "spago build",
"build:pulp": "pulp build -o output-pulp",
"clean": "rm -rf .spago bower_components output output-pulp node_modules .pulp-cache .psci_modules"
"clean": "rm -rf .spago bower_components output output-pulp node_modules .pulp-cache .psci_modules",
"test": "spago -x test.dhall test"
}
}
2 changes: 1 addition & 1 deletion src/React/Basic/DOM/Server.js
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;
6 changes: 6 additions & 0 deletions test.dhall
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" ]
}
18 changes: 18 additions & 0 deletions test/Main.purs
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` ""