sorla-db 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +0,0 @@
1
- const chai = require('chai');
2
- const expect = chai.expect;
3
- const faker = require('faker');
4
- const documents = require('../src/documents/document.js');
5
-
6
- describe('testing document capabilities', () => {
7
- it('checking capabilities of getting a field inside a object', () => {
8
- const doc = new documents({
9
- name: 'Anderson',
10
- test: {
11
- inscription: 123
12
- }
13
- });
14
-
15
- expect(doc.name).to.equal('Anderson');
16
- });
17
-
18
- it('checking capabilities of getting a field inside a object', () => {
19
- const doc = new documents({
20
- name: 'Anderson',
21
- test: {
22
- inscription: 123
23
- }
24
- });
25
-
26
- expect(doc.test.inscription).to.equal(123);
27
- });
28
-
29
- it('checking capabilities of getting a field inside a object', () => {
30
- const doc = new documents({
31
- name: 'Anderson',
32
- test: {
33
- inscription: 123
34
- }
35
- });
36
-
37
- expect(doc['test.inscription']).to.equal(123);
38
- });
39
- });
@@ -1,42 +0,0 @@
1
- const chai = require('chai')
2
- const expect = chai.expect
3
- const faker = require('faker')
4
-
5
- const sorla = require('../src/sorla.js')
6
-
7
- describe('SORLA Unit Test', () => {
8
- it('Should create a new database with random name', () => {
9
- const srla = new sorla();
10
- const dbname = faker.random.word();
11
- srla.createDb(dbname);
12
- srla.useDb(dbname);
13
-
14
- expect(srla.countDb()).to.equal(1);
15
- expect(srla.dbExists(dbname)).to.equal(true);
16
- expect(srla.db.name).to.equal(dbname);
17
- });
18
-
19
- it('Should not create a new database with the same name', () => {
20
- const srla = new sorla();
21
- const dbname = faker.random.word();
22
- srla.createDb(dbname);
23
-
24
- expect(srla.createDb(dbname)).to.equal(false);
25
- });
26
-
27
- it('Should created more than one database', () => {
28
- const srla = new sorla();
29
- for(let i=0; i<2; i++)
30
- {
31
- const dbname = faker.random.word();
32
- srla.createDb(dbname);
33
- }
34
-
35
- expect(srla.countDb()).to.equal(2);
36
- });
37
-
38
- it('Should not have any database created', () => {
39
- const srla = new sorla();
40
- expect(srla.countDb()).to.equal(0);
41
- });
42
- });
@@ -1,25 +0,0 @@
1
- const chai = require('chai');
2
- const expect = chai.expect;
3
-
4
- const sorla = require('../src/sorla.js');
5
-
6
- describe('Sorla Class', () => {
7
- it('should create a new database', () => {
8
- const srla = new sorla();
9
- srla.createDb('test');
10
- expect(srla.countDb()).to.equal(1);
11
- });
12
-
13
- it('should not create a new database with the same name', () => {
14
- const srla = new sorla();
15
- srla.createDb('test');
16
- expect(srla.createDb('test')).to.equal(false);
17
- });
18
-
19
- it('should created a new database and select it', () => {
20
- const srla = new sorla();
21
- const dbname = 'test';
22
- srla.useDb(dbname);
23
- expect(srla.db.name).to.equal(dbname);
24
- });
25
- });
package/webpack.config.js DELETED
@@ -1,11 +0,0 @@
1
- const path = require('path');
2
-
3
- module.exports = {
4
- mode: "production",
5
- target: "web",
6
- entry: './src/sorla.js',
7
- output: {
8
- path: path.resolve(__dirname, 'dist'),
9
- filename: 'sorla.min.js'
10
- }
11
- }