diff --git a/.circleci/config.yml b/.circleci/config.yml index 908210e13..bd7493f6b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,6 +43,20 @@ jobs: name: Perform linting command: npm run lint + # unit_tests will run the unit tests. + unit_tests: + <<: *job_defaults + steps: + - checkout + - attach_workspace: + at: ~/coralproject/talk + - run: + name: Compile schemas and types + command: npm run compile + - run: + name: Perform testing + command: npm run test + # build will build the static assets and server typescript files. build: <<: *job_defaults @@ -74,6 +88,9 @@ workflows: - lint: requires: - npm_dependencies + - unit_tests: + requires: + - npm_dependencies - build: requires: - npm_dependencies diff --git a/config/jest/cssTransform.js b/config/jest/cssTransform.js index da313e9ea..4962e94f9 100644 --- a/config/jest/cssTransform.js +++ b/config/jest/cssTransform.js @@ -2,7 +2,11 @@ // Adapted version of https://github.com/Connormiha/jest-css-modules-transform // Copyright https://github.com/Connormiha/jest-css-modules-transform/graphs/contributors +<<<<<<< HEAD // This oututs `module.exports = cssObject` instead of `module.defaults = cssObject`; +======= +// This oututs `module.exports = cssObject` instead of `module.exports = { default: cssObject }`; +>>>>>>> next const { sep: pathSep, resolve } = require("path"); const postcss = require("postcss"); diff --git a/package.json b/package.json index 03d25cacd..820605d35 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,11 @@ "scripts": { "start": "node dist/index.js", "test": "node scripts/test.js --env=jsdom", - "build": "npm-run-all --parallel compile:* && npm-run-all --parallel build:*", + "build": "npm-run-all compile --parallel build:*", "build:client": "node ./scripts/build.js", "build:server": "tsc -p ./src/tsconfig.json", "watch": "NODE_ENV=development ts-node ./scripts/watcher/bin/watcher.ts ./config/watcher.ts", + "compile": "npm-run-all --parallel compile:*", "compile:css-types": "tcm src/core/client/", "compile:relay-stream": "relay-compiler --src ./src/core/client/stream --schema $(ts-node ./scripts/schemaPath.ts tenant) --language typescript --artifactDirectory ./src/core/client/stream/__generated__ --no-watchman", "start:development": "NODE_ENV=development ts-node --project ./src/tsconfig.json -r tsconfig-paths/register ./src/index.ts", diff --git a/scripts/test.js b/scripts/test.js index 1ac08fd2e..f08b18de6 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -19,11 +19,11 @@ const paths = require("../config/paths"); const jest = require("jest"); let argv = process.argv.slice(2); +argv.push("--config", paths.appJestConfig); // Watch unless on CI or in coverage mode if (!process.env.CI && argv.indexOf("--coverage") < 0) { argv.push("--watch"); - argv.push("--config", paths.appJestConfig); } jest.run(argv);