0.1.7 • Published 7 years ago

pisco-cells-component-structural-testing v0.1.7

Weekly downloads
1
License
Apache Licence 2
Repository
-
Last release
7 years ago

Step structural-testing

Structural testing for cells components

A list of files will be checked if its exist, and some will also search some content within the file.

Get Started

Installation:

$ npm install -g pisco-cells-component-structural-testing

Then execute inside of a component

$ cd my-webcomponent
$ cells component::structural-testing

Configure your own structural testing

Add a .piscosour/piscosour.json file in the root of your component with the files that you want to validate:

{
  "params": {
    "structuralTesting": {
      "active": true,
      "files": {
        ".gitignore": {
          "content": [ "bower_components", "components"]
        },
        "bower.json": {
          "content": [ "description" ]
        },
        "index.html": {},
        "README.md": {},
        "{{componentName}}.html": {
          "content": [ "{{componentName}}" ]
        },
        "{{componentName}}.js": {
          "content": [ "{{componentName}}" ]
        },
        "demo/index.html": {
          "content": [ "{{componentName}}.html" ]
        },
        "test/index.html": {}
      }
    }
  }
}

Where content is an array of test to search inside of a file. If content is not declared then it will just check that the file exists.

Note that this configuration will be merged with default configuration, if you want to omit a file from default configuration, you can add skip: true. For example if you want to skip .ignore file, then:

{
  "params": {
    "structuralTesting": {
      "active": true,
      "files": {
        ".gitignore": {
          "skip": true
        }
      }
    }
  }
}