From f9a10c90f5d6aec72664c283946e1948a53fd370 Mon Sep 17 00:00:00 2001 From: Kael Zhang Date: Sat, 20 Apr 2019 11:47:34 +0800 Subject: [PATCH] first commit --- .editorconfig | 9 ++++++ .eslintignore | 3 ++ .eslintrc.js | 3 ++ .gitignore | 64 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 5 +++ HISTORY.md | 1 + LICENSE | 21 +++++++++++++ README.md | 34 +++++++++++++++++++++ appveyor.yml | 22 ++++++++++++++ package.json | 44 +++++++++++++++++++++++++++ src/index.js | 0 test/@caviar/test.test.js | 7 +++++ 12 files changed, 213 insertions(+) create mode 100644 .editorconfig create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 HISTORY.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 appveyor.yml create mode 100644 package.json create mode 100644 src/index.js create mode 100644 test/@caviar/test.test.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7ef72b0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*.{js,css,md}] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 \ No newline at end of file diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..f6fe99d --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +/* +!src +!test diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..5abb914 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: require.resolve('eslint-config-ostai') +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e4c9029 --- /dev/null +++ b/.gitignore @@ -0,0 +1,64 @@ +# Node, Coverage, NPM +/.nyc_output +/coverage +/coverage.lcov +/package-lock.json +/*.tgz + + +# Numerous always-ignore extensions +*.bak +*.patch +*.diff +*.err +*.orig +*.log +*.rej +*.swo +*.swp +*.zip +*.vi +*~ +*.sass-cache +*.lock +*.rdb +*.db +nohup.out + +# OS or Editor folders +.DS_Store +._* +.cache +.project +.settings +.tmproj +*.esproj +*.*-project +*.*-workspace +nbproject +thumbs.db + +# Folders to ignore +.hg +.svn +.CVS +.idea +node_modules +old/ +*-old/ +*-notrack/ +no-track/ +build/ +combo/ +reference/ +jscoverage_lib/ +temp/ +tmp/ + +# Java +.mvn +.gradle +.vscode +.project +.classpath +/gradle diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1d6ebcf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +sudo: false +node_js: + - "8" + - "10" diff --git a/HISTORY.md b/HISTORY.md new file mode 100644 index 0000000..e061a53 --- /dev/null +++ b/HISTORY.md @@ -0,0 +1 @@ +# History diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fedca17 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2013 kaelzhang <>, contributors +http://kael.me/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..19f9b5a --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +[![Build Status](https://travis-ci.org/kaelzhang/caviar-test.svg?branch=master)](https://travis-ci.org/kaelzhang/caviar-test) +[![Coverage](https://codecov.io/gh/kaelzhang/caviar-test/branch/master/graph/badge.svg)](https://codecov.io/gh/kaelzhang/caviar-test) + + + + + +# @caviar/test + +Testing utility for caviar + +## Install + +```sh +$ npm i @caviar/test +``` + +## Usage + +```js +import @caviar/test from '@caviar/test' +``` + +## License + +[MIT](LICENSE) diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..e4ab34a --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,22 @@ +# Test against this version of Node.js +environment: + matrix: + - nodejs_version: "8" + - nodejs_version: "10" + +# Install scripts. (runs after repo cloning) +install: + # Get the latest stable version of Node.js or io.js + - ps: Install-Product node $env:nodejs_version + # install modules + - npm install + +# Post-install test scripts. +test_script: + # Output useful info for debugging. + - node --version + - npm --version + - npm test + +# Don't actually build. +build: off diff --git a/package.json b/package.json new file mode 100644 index 0000000..3684a01 --- /dev/null +++ b/package.json @@ -0,0 +1,44 @@ +{ + "name": "@caviar/test", + "version": "1.0.0", + "description": "Testing utility for caviar", + "main": "src/index.js", + "scripts": { + "test": "NODE_DEBUG=@caviar/test nyc ava --timeout=10s --verbose", + "test:only": " nyc ava --timeout=10s --verbose", + "lint": "eslint .", + "posttest": "nyc report --reporter=text-lcov > coverage.lcov && codecov" + }, + "files": [ + "src/" + ], + "repository": { + "type": "git", + "url": "git://github.com/kaelzhang/caviar-test.git" + }, + "keywords": [ + "@caviar/test" + ], + "engines": { + "node": ">= 6" + }, + "ava": { + "babel": false, + "files": [ + "test/*.test.js" + ] + }, + "author": "kaelzhang", + "license": "MIT", + "bugs": { + "url": "https://github.com/kaelzhang/caviar-test/issues" + }, + "devDependencies": { + "ava": "^1.4.1", + "codecov": "^3.3.0", + "nyc": "^13.3.0", + "eslint-config-ostai": "^3.0.0", + "eslint-plugin-import": "^2.16.0", + "eslint": "^5.16.0" + } +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..e69de29 diff --git a/test/@caviar/test.test.js b/test/@caviar/test.test.js new file mode 100644 index 0000000..a7cf3ad --- /dev/null +++ b/test/@caviar/test.test.js @@ -0,0 +1,7 @@ +const test = require('ava') +const log = require('util').debuglog('@caviar/test') +const @caviar/test = require('../src') + +test('description', t => { + t.is(true, true) +})