Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests #8

Merged
merged 35 commits into from
Dec 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ea8ccf1
Merge branch 'master' into 'infra/add-tests'
okv Dec 12, 2019
c63a368
add tape and related tools to dev deps
okv Dec 13, 2019
484b998
add lib/index
okv Dec 13, 2019
c5c5a37
add first module test
okv Dec 13, 2019
f09476a
add test for connect method
okv Dec 14, 2019
405f603
use tap_bail
okv Dec 14, 2019
d4bd1c4
drop tap-bail
okv Dec 14, 2019
782cec0
use tap-promise
okv Dec 14, 2019
dfbe1f4
add travis config
okv Dec 14, 2019
410055e
fix language at travis config
okv Dec 14, 2019
d83b64e
setup mongodb in ci script; allow 2.x and 3.x drivers as dev dependency
okv Dec 14, 2019
6fd9c3b
use blue tape
okv Dec 14, 2019
e4c05bd
mongodb versions in travis config
okv Dec 14, 2019
73bd9cc
do not test with mongodb 4 for now
okv Dec 14, 2019
4b981ca
add testing on mongodb 4.0.13
okv Dec 14, 2019
a0496ae
make dir for connect tests
okv Dec 15, 2019
f48eff2
add tests for disconnect adapter method
okv Dec 15, 2019
17d5694
add some test for getExecutedMigrationNames method
okv Dec 15, 2019
734d84b
add getExecutedMigrationNames method with executed migrations test
okv Dec 16, 2019
0e99961
add markExecuted with executed migrations test
okv Dec 16, 2019
bee3f92
add markExecuted without executed migrations test
okv Dec 16, 2019
ab160d1
add unmarkExecuted with executed migrations test
okv Dec 17, 2019
81e58e3
add unmarkExecuted without executed migrations test
okv Dec 17, 2019
ef9a9b9
change some label in tests
okv Dec 18, 2019
af85a7b
add nyc and makeCodeCoverageSummaryReport script
okv Dec 18, 2019
05cf6dd
add nyc and makeCodeCoverageDetailReport script
okv Dec 20, 2019
533540d
add coverage to git and npm ignore
okv Dec 20, 2019
9160a9a
add test for getTemplatePath
okv Dec 20, 2019
0043fc1
reports coverage to coveralls
okv Dec 24, 2019
26e3089
add travis badge to readme
okv Dec 24, 2019
1230790
add coveralls badge to readme
okv Dec 24, 2019
a7547cb
enable at tests mongodb options only when options are supported by dr…
okv Dec 24, 2019
4b33803
add test for dropIndexIfExists and existing index
okv Dec 25, 2019
794fd14
add test for dropIndexIfExists and not existing index
okv Dec 25, 2019
a661c40
test with bail by default
okv Dec 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
coverage/
.nyc_output
7 changes: 5 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
test/
coverage/
.nyc_output
.npmignore
.npmrc
test

.travis.yml
.nycrc
13 changes: 13 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"cache": true,
"all": true,
"exclude": [
"node_modules/**",
"test/**",
"testUtils/**",
"tap-snapshots/**",
"coverage/**",
"migrations/**",
"lib/migrationTemplate.js"
]
}
46 changes: 46 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
language: node_js

node_js:
- "stable"
- "12"
- "10"
- "8"
- "6"
- "4"

sudo: false

env:
- MONGODB_VERSION=2.4.14 MONGODB_DRIVER_VERSION=2.x.x
- MONGODB_VERSION=3.6.16 MONGODB_DRIVER_VERSION=2.x.x
- MONGODB_VERSION=4.0.13 MONGODB_DRIVER_VERSION=3.x.x

before_script:
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${MONGODB_VERSION}.tgz -O /tmp/mongodb.tgz
- tar -xvf /tmp/mongodb.tgz
- mkdir /tmp/data
- ${PWD}/mongodb-linux-x86_64-${MONGODB_VERSION}/bin/mongod --dbpath /tmp/data &> /dev/null &
- ${PWD}/mongodb-linux-x86_64-${MONGODB_VERSION}/bin/mongod --version
- until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 1; done
- npm install mongodb@${MONGODB_DRIVER_VERSION}

script:
- >
nodeVersionMajor=`node --version | grep -Eo 'v[0-9]+' | sed 's/v//'`;

if [ $nodeVersionMajor -gt 4 ]; then
npm test;
else
npm run testWithoutBail;
fi;

- >
nodeVersionMajor=`node --version | grep -Eo 'v[0-9]+' | sed 's/v//'`;

if [ $nodeVersionMajor -eq 12 ]; then
npm run makeCodeCoverageSummaryReport;
npm run makeCodeCoverageDetailReport;
coveralls < coverage/lcov.info;
else
echo "*** Do not make coverage reports for non node.js 12 builds ($nodeVersionMajor)";
fi;
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ which can be used for dropping index in safe way (contrasting to


[![Npm version](https://img.shields.io/npm/v/east-mongo.svg)](https://www.npmjs.org/package/east-mongo)
[![Build Status](https://travis-ci.org/okv/east-mongo.svg?branch=master)](https://travis-ci.org/okv/east-mongo)
[![Coverage Status](https://coveralls.io/repos/github/okv/east-mongo/badge.svg?branch=master)](https://coveralls.io/github/okv/east-mongo?branch=master)
[![Known Vulnerabilities](https://snyk.io/test/npm/east-mongo/badge.svg)](https://snyk.io/test/npm/east-mongo)


Expand Down
1 change: 1 addition & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./adapter');
Loading