GithubHelp home page GithubHelp logo

cta-common's Introduction

cta-common

Build Status Coverage Status codecov

Common Modules for Compass Test Automation, One of Libraries in CTA-OSS Framework

General Overview

Overview

In cta-common, there are four modules as following:

  1. ConfigModule
  2. LoaderModule
  3. RootModule
  4. ValidateModule

These modules providing common functions across CTA-OSS.

Guidelines

We aim to give you brief guidelines here.

const cta_common = require("cta-common");

1. ConfigModule

It loads the config for specified module using file structure: [module_root]/lib/apps/main/config.

const moduleName = "sample-module";
const config = cta_common.config(moduleName);

The file, which locates at sample-module/lib/apps/main/config/index.js, is loaded as the config.

2. LoaderModule

It loads modules from all *.js files in specified directory. Other extension files are excluded.

For example: there are three files in directory: module1.js, module2.js, and module3.js

Output as Array

const sampleDirectory = "sample-directory";
const array_output = cta_common.loader.asArray(sampleDirectory);
// array_output = [ {default_export_module1}, {default_export_module2}, {default_export_module3} ]

Output as Object

const sampleDirectory = "sample-directory";
const object_output = cta_common.loader.asObject(sampleDirectory);
// object_output = {
//   module1: {default_export_module1},
//   module2: {default_export_module2},
//   module3: {default_export_module3},
// }

3. RootModule

It resolves the root directory of module.

const moduleName = "samplemodule";
const root = cta_common.root(moduleName);

For example, [executing_application]/node_modules/samplemodule

4. ValidateModule

It validates the input against specified pattern.

const input = { value: "sample input" };
const pattern = "object";

const output = cta_common.validate(input, pattern);

This module is used to validate a bridge and a tool in CTA-OSS.

To Do

Plan for next release

cta-common's People

Contributors

kiettisak-angkanawin avatar panit-tr avatar pattama avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

pattama

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.