Skip to content

Commit

Permalink
chore(package): Move adapter tests into their own module (#1164)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Removes adapter tests from @feathersjs/adapter-commons
  • Loading branch information
daffl committed Jan 10, 2019
1 parent 4d4be7a commit dcc1e6b
Show file tree
Hide file tree
Showing 14 changed files with 475 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ plugins:
count_threshold: 3
exclude_patterns:
- "**/test/*"
- "**/tests/*"
- "**/adapter-tests/lib/*"
- "**/dist/*"
- "**/*.dist.js"
- "**/templates/*"
4 changes: 2 additions & 2 deletions packages/adapter-commons/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Feathers Adapter Commons

[![Build Status](https://travis-ci.org/feathersjs/feathers.png?branch=master)](https://travis-ci.org/feathersjs/feathers)
[![Dependency Status](https://img.shields.io/david/feathersjs/feathers.svg?style=flat-square&path=packages/commons)](https://david-dm.org/feathersjs/feathers?path=packages/commons)
[![Dependency Status](https://img.shields.io/david/feathersjs/feathers.svg?style=flat-square&path=packages/adapter-commons)](https://david-dm.org/feathersjs/feathers?path=packages/adapter-commons)
[![Download Status](https://img.shields.io/npm/dm/@feathersjs/adapter-commons.svg?style=flat-square)](https://www.npmjs.com/package/@feathersjs/adapter-commons)

> Shared utility functions for Feathers adatabase adapters
Expand All @@ -13,7 +13,7 @@ This is a repository for handling Feathers common database syntax.

## Authors

[Feathers contributors](https://github.com/feathersjs/commons/graphs/contributors)
[Feathers contributors](https://github.com/feathersjs/adapter-commons/graphs/contributors)

## License

Expand Down
1 change: 0 additions & 1 deletion packages/adapter-commons/tests.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/adapter-tests/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/
5 changes: 5 additions & 0 deletions packages/adapter-tests/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

22 changes: 22 additions & 0 deletions packages/adapter-tests/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2019 Feathers

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.

22 changes: 22 additions & 0 deletions packages/adapter-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Feathers Adapter Tests

[![Build Status](https://travis-ci.org/feathersjs/feathers.png?branch=master)](https://travis-ci.org/feathersjs/feathers)
[![Dependency Status](https://img.shields.io/david/feathersjs/feathers.svg?style=flat-square&path=packages/adapter-tests)](https://david-dm.org/feathersjs/feathers?path=packages/adapter-tests)
[![Download Status](https://img.shields.io/npm/dm/@feathersjs/adapter-commons.svg?style=flat-square)](https://www.npmjs.com/package/@feathersjs/adapter-commons)

> Feathers shared database adapter test suite
## About

This is a repository that contains the test suite for the common database adapter syntax.


## Authors

[Feathers contributors](https://github.com/feathersjs/adapter-tests/graphs/contributors)

## License

Copyright (c) 2018 Feathers contributors

Licensed under the [MIT license](LICENSE).
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ module.exports = (test, app, errors, serviceName, idProp) => {
'Got a NotFound Feathers error'
);
}

try {
await service.get(doug[idProp], {
query: { [idProp]: '568225fbfe21222432e836ff' }
});
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
'Got a NotFound Feathers error'
);
}
});

test('.get + NotFound', async () => {
Expand Down Expand Up @@ -102,6 +113,17 @@ module.exports = (test, app, errors, serviceName, idProp) => {
'Got a NotFound Feathers error'
);
}

try {
await service.remove(doug[idProp], {
query: { [idProp]: '568225fbfe21222432e836ff' }
});
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
'Got a NotFound Feathers error'
);
}
});

test('.remove + multi', async () => {
Expand Down Expand Up @@ -181,6 +203,19 @@ module.exports = (test, app, errors, serviceName, idProp) => {
'Got a NotFound Feathers error'
);
}

try {
await service.update(doug[idProp], {
name: 'Dougler'
}, {
query: { [idProp]: '568225fbfe21222432e836ff' }
});
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
'Got a NotFound Feathers error'
);
}
});

test('.update + NotFound', async () => {
Expand Down Expand Up @@ -234,6 +269,19 @@ module.exports = (test, app, errors, serviceName, idProp) => {
'Got a NotFound Feathers error'
);
}

try {
await service.patch(doug[idProp], {
name: 'id patched doug'
}, {
query: { [idProp]: '568225fbfe21222432e836ff' }
});
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
'Got a NotFound Feathers error'
);
}
});

test('.patch multiple', async () => {
Expand Down
File renamed without changes.
Loading

0 comments on commit dcc1e6b

Please sign in to comment.