@@ -80,8 +80,8 @@ mkCdYear doc node = liftEffect $ XP.evaluateString
8080 Nothing
8181 doc
8282
83- main :: Effect Unit
84- main = runTest do
83+ main :: { browser :: Boolean } -> Effect Unit
84+ main { browser } = runTest do
8585 suite " non-namespaced tests" do
8686 test " note.xml and catalog.xml" do
8787 domParser <- liftEffect $ makeDOMParser
@@ -148,22 +148,23 @@ main = runTest do
148148 Assert .assertFalse " custom NS resolver shouldn't be null"
149149 (isNull $ unsafeToForeign customRes)
150150
151- atomFeedDoc <- liftEffect $ parseAtomFeedDoc domParser
152- atomFeed <- pure $ toNode atomFeedDoc
151+ when browser $ do
152+ atomFeedDoc <- liftEffect $ parseAtomFeedDoc domParser
153+ atomFeed <- pure $ toNode atomFeedDoc
153154
154- createdNSResolver <- pure $ XP .createNSResolver atomFeed atomFeedDoc
155- Assert .assertFalse " created NS resolver shouldn't be undefined"
156- (isUndefined $ unsafeToForeign createdNSResolver)
157- Assert .assertFalse " created NS resolver shouldn't be null"
158- (isNull $ unsafeToForeign createdNSResolver)
155+ createdNSResolver <- pure $ XP .createNSResolver atomFeed atomFeedDoc
156+ Assert .assertFalse " created NS resolver shouldn't be undefined"
157+ (isUndefined $ unsafeToForeign createdNSResolver)
158+ Assert .assertFalse " created NS resolver shouldn't be null"
159+ (isNull $ unsafeToForeign createdNSResolver)
159160
160- defNSResolver <- liftEffect $ XP .defaultNSResolver atomFeed atomFeedDoc
161- Assert .assertFalse " default NS resolver shouldn't be undefined"
162- (isUndefined $ unsafeToForeign defNSResolver)
163- Assert .assertFalse " default NS resolver shouldn't be null"
164- (isNull $ unsafeToForeign defNSResolver)
161+ defNSResolver <- liftEffect $ XP .defaultNSResolver atomFeed atomFeedDoc
162+ Assert .assertFalse " default NS resolver shouldn't be undefined"
163+ (isUndefined $ unsafeToForeign defNSResolver)
164+ Assert .assertFalse " default NS resolver shouldn't be null"
165+ (isNull $ unsafeToForeign defNSResolver)
165166
166- test " atom.xml" do
167+ test " atom.xml" $ when browser do
167168 domParser <- liftEffect $ makeDOMParser
168169
169170 atomFeedDoc <- liftEffect $ parseAtomFeedDoc domParser
@@ -198,7 +199,7 @@ main = runTest do
198199 metajeloId <- liftEffect $ XP .stringValue metajeloIdRes
199200 tlog $ " got metajelo id" <> metajeloId
200201 Assert .equal RT .string_type (XP .resultType metajeloIdRes)
201- Assert .equal " OjlTjf" metajeloId
202+ when browser $ Assert .equal " OjlTjf" metajeloId
202203
203204 prod0pol0xpath <- pure $
204205 " /x:record/x:supplementaryProducts/x:supplementaryProduct[1]" <>
@@ -214,7 +215,7 @@ main = runTest do
214215 mjProd0Pol0 <- liftEffect $ XP .stringValue mjProd0Pol0Res
215216 tlog $ " got metajelo ref policy " <> mjProd0Pol0
216217 Assert .equal RT .string_type (XP .resultType mjProd0Pol0Res)
217- Assert .equal " http://skGHargw/" mjProd0Pol0
218+ when browser $ Assert .equal " http://skGHargw/" mjProd0Pol0
218219 --
219220 mjProd0Pol0AppliesRes <- liftEffect $ XP .evaluate
220221 (prod0pol0xpath <> " /@appliesToProduct" )
@@ -226,7 +227,7 @@ main = runTest do
226227 mjProd0Pol0Applies <- liftEffect $ XP .stringValue mjProd0Pol0AppliesRes
227228 tlog $ " got metajelo policy appliesToProduct: " <> (show mjProd0Pol0Applies)
228229 Assert .equal RT .string_type (XP .resultType mjProd0Pol0AppliesRes)
229- Assert .equal " 0" mjProd0Pol0Applies
230+ when browser $ Assert .equal " 0" mjProd0Pol0Applies
230231
231232tlog :: forall a . Show a => a -> Aff Unit
232233tlog = liftEffect <<< logShow
0 commit comments