Skip to content

Commit

Permalink
adds should fail tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roryc89 committed Jan 26, 2021
1 parent d23e2fa commit f74357d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ jobs:
- run: npm i
- run: npm run bundle
- run: node ./run-example-tests.js
- run: node ./run-should-fail-tests.js

17 changes: 8 additions & 9 deletions run-example-tests.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
const { readdirSync } = require('fs')
const {promisify} = require('util')
const exec = promisify(require("exec-sh"))
const { promisify } = require('util')
const exec = promisify(require('exec-sh'))

const getDirectories = source =>
readdirSync(source, { withFileTypes: true })
.filter(dirent => dirent.isDirectory())
.map(dirent => dirent.name)

const go = async () => {
const packages = getDirectories('./examples')

const packages = getDirectories('./examples');

for(let package of packages){
console.log(`Testing ${package}`);
await exec(`cd "./examples/${package}" && npm t`)
}
for (const p of packages) {
console.log(`Testing ${p}`)
await exec(`cd "./examples/${p}" && npm t`)
}
}

go()
go()
10 changes: 2 additions & 8 deletions src/GraphQL/Client/Args.purs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Data.DateTime (DateTime)
import Data.Maybe (Maybe)
import Data.Symbol (class IsSymbol, SProxy)
import Data.Time (Time)
import Data.Typelevel.Bool (False, True)
import Heterogeneous.Folding (class FoldingWithIndex, class HFoldlWithIndex)
import Heterogeneous.Mapping (class HMapWithIndex, class MappingWithIndex)
import Prim.Row as Row
Expand All @@ -33,17 +32,12 @@ infixr 6 AndArg as ++

class ArgGql params arg

instance argToGqlNotNull :: (MaybeNotAllowedForNotNullArgs False arg, ArgGql param arg) => ArgGql (NotNull param) arg
else instance argToGqlMaybe :: ArgGql param arg => ArgGql param (Maybe arg)
instance argToGqlNotNull :: ArgGql param arg => ArgGql (NotNull param) arg
-- else instance argToGqlMaybe :: ArgGql param arg => ArgGql param (Maybe arg)
else instance argToGqlArray :: ArgGql param arg => ArgGql (Array param) (Array arg)
else instance argToGqlArrayAnd :: (ArgGql param a1, ArgGql (Array param) a2) => ArgGql (Array param) (AndArg a1 a2)
else instance argToGqlArrayOne :: ArgGql param arg => ArgGql (Array param) arg

class MaybeNotAllowedForNotNullArgs b t | b -> t

instance isMaybe :: MaybeNotAllowedForNotNullArgs True (Maybe a)

instance isNotMaybe :: MaybeNotAllowedForNotNullArgs False a

instance argToGqlInt :: ArgGql Int Int
instance argToGqlNumber :: ArgGql Number Number
Expand Down

0 comments on commit f74357d

Please sign in to comment.