Skip to content
This repository was archived by the owner on Jun 15, 2019. It is now read-only.

Commit a01dae0

Browse files
committed
test(jest.outms.config.json): A test was added to check outputs' module-system
This is needed for the next commit (that manipulates build outputs)
1 parent 57ebdd4 commit a01dae0

File tree

8 files changed

+854
-46
lines changed

8 files changed

+854
-46
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ jobs:
88
include:
99
- stage: "Unit Tests"
1010
name: "Unit Test (11)"
11-
if: type == push && tag !~ ^v\d+\.\d+\.\d+ && commit_message =~ /^(test|feat|fix|refactor|pref|build|revert)\(/
11+
if: type == push && tag !~ ^v\d+\.\d+\.\d+ && commit_message =~ /^(test|feat|fix|refactor|pref|revert)\(/
1212
node_js: "11"
1313
before_script: echo -e "BUILD_DIR = $TRAVIS_BUILD_DIR\nBUILD_ID = $TRAVIS_BUILD_ID\nBUILD_NUMBER = $TRAVIS_BUILD_NUMBER\nBUILD_WEB_URL = $TRAVIS_BUILD_WEB_URL\nCOMMIT = $TRAVIS_COMMIT\nCOMMIT_MESSAGE = $TRAVIS_COMMIT_MESSAGE\nCOMMIT_RANGE = $TRAVIS_COMMIT_RANGE\nDEBUG_MODE = $TRAVIS_DEBUG_MODE\nEVENT_TYPE = $TRAVIS_EVENT_TYPE\nJOB_ID = $TRAVIS_JOB_ID\nJOB_NAME = $TRAVIS_JOB_NAME\nJOB_NUMBER = $TRAVIS_JOB_NUMBER\nJOB_WEB_URL = $TRAVIS_JOB_WEB_URL\nOS_NAME = $TRAVIS_OS_NAME\nOSX_IMAGE = $TRAVIS_OSX_IMAGE\nPULL_REQUEST = $TRAVIS_PULL_REQUEST\nPULL_REQUEST_BRANCH= $TRAVIS_PULL_REQUEST_BRANCH\nPULL_REQUEST_SHA = $TRAVIS_PULL_REQUEST_SHA\nPULL_REQUEST_SLUG = $TRAVIS_PULL_REQUEST_SLUG\nSECURE_ENV_VARS = $TRAVIS_SECURE_ENV_VARS\nSUDO = $TRAVIS_SUDO\nTEST_RESULT = $TRAVIS_TEST_RESULT\nTAG = $TRAVIS_TAG\nBUILD_STAGE_NAME = $TRAVIS_BUILD_STAGE_NAME"
14-
script: npm run test:prod
14+
script: npm run test:unit:prod
1515
- name: "Unit Test (10) + Report Coverage"
16-
if: type == push && tag !~ ^v\d+\.\d+\.\d+ && commit_message =~ /^(test|feat|fix|refactor|pref|build|revert)\(/
16+
if: type == push && tag !~ ^v\d+\.\d+\.\d+ && commit_message =~ /^(test|feat|fix|refactor|pref|revert)\(/
1717
node_js: "10"
18-
script: npm run test:prod
18+
script: npm run test:unit:prod
1919
after_success: npx codecov
2020

2121
- stage: "Release"
2222
name: "Build and Release"
2323
if: type == push && tag !~ ^v\d+\.\d+\.\d+ && branch == master && commit_message =~ /^(feat|fix|refactor|pref|build|revert)\(/
2424
script: npm run build:prod
25+
after_success: npm run test:outms
2526
node_js: lts/*
2627
deploy:
2728
provider: script

babel.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @author [S. Mahdi Mir-Ismaili](https://mirismaili.github.io)
3+
* Created on 1398/2/31 (2019/5/21).
4+
*/
5+
"use strict"
6+
7+
// Just for jest outms (outputs' module-system) tests! See: https://jestjs.io/docs/en/getting-started#using-babel
8+
module.exports = {
9+
presets: [
10+
['@babel/preset-env', {targets: {node: 'current'}}],
11+
],
12+
};

jest.outms.config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"testEnvironment": "node",
3+
"testRegex": "\\.test\\.outms\\.js$"
4+
}

jest.config.js renamed to jest.unit.config.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@ module.exports = {
99
".(ts|tsx)": "ts-jest"
1010
},
1111
testEnvironment: "node",
12-
testRegex: "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
13-
moduleFileExtensions: [
14-
"ts",
15-
"tsx",
16-
"js",
17-
],
12+
testRegex: "\\.(test|spec)\\.(ts|tsx|js)$",
1813
coveragePathIgnorePatterns: [
1914
"/node_modules/",
2015
"/test/",
16+
"/dist/",
2117
"/src/utilities.ts",
2218
],
2319
coverageThreshold: {
@@ -31,4 +27,5 @@ module.exports = {
3127
collectCoverageFrom: [
3228
"src/*.{js,ts}",
3329
],
30+
coverageDirectory: 'coverage/unit',
3431
}

0 commit comments

Comments
 (0)