Skip to content

Commit

Permalink
Compile to es2015.
Browse files Browse the repository at this point in the history
  • Loading branch information
nozzlegear committed Aug 31, 2017
1 parent 092d547 commit 48b91c7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
"logspect": "^1.0.2"
},
"devDependencies": {
"@types/lodash": "^4.14.74",
"alsatian": "^1.3.1",
"lodash": "^4.17.4",
"rimraf": "^2.5.4",
"tap-bark": "^1.0.0",
"typescript": "^2.3.3",
Expand Down
9 changes: 5 additions & 4 deletions tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
Timeout
} from 'alsatian';
import { DavenportError } from '../index';
import range = require("lodash/range");

const DB_URL = "http://localhost:5984";
const DB_NAME = "davenport_tests";
Expand Down Expand Up @@ -519,7 +520,7 @@ export class DavenportTestFixture {
@AsyncTest("Davenport.bulk insert with auto-generated ids.")
@Timeout(5000)
public async bulkTest() {
const docs = [...Array(100).keys()].map<TestObject>(i => ({
const docs = range(0, 100).map<TestObject>(i => ({
bar: i,
foo: i * 3,
hello: "world"
Expand All @@ -537,7 +538,7 @@ export class DavenportTestFixture {
@Timeout(5000)
public async bulkWithCustomIdsTest() {
const generatedIds: string[] = [];
const docs = [...Array(100).keys()].map<TestObject>(i => {
const docs = range(0, 100).map<TestObject>(i => {
const id = this.guid();
generatedIds.push(id);

Expand All @@ -562,12 +563,12 @@ export class DavenportTestFixture {
const client = getClient();
const totalExisting = 10;
const totalOperations = 100;
const existingDocs = await client.bulk([...Array(totalExisting).keys()].map<TestObject>(i => ({
const existingDocs = await client.bulk(range(0, totalExisting).map<TestObject>(i => ({
bar: i,
foo: i * 5,
hello: "I'm an existing doc, used with the bulkWithConflicts test."
})));
const result = await client.bulk([...Array(totalOperations).keys()].map<TestObject>(i => {
const result = await client.bulk(range(0, totalOperations).map<TestObject>(i => {
const existingDoc = existingDocs[i];
const id = existingDoc ? existingDoc.id : undefined;

Expand Down
9 changes: 6 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"target": "es5",
"noImplicitAny": false,
"sourceMap": true,
"outDir": "bin",
"experimentalDecorators": true,
"declaration": true
},
"declaration": true,
"lib": [
"es2015"
]
},
"exclude": [
"node_modules",
"bin"
Expand Down
6 changes: 5 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"@types/minimatch" "*"
"@types/node" "*"

"@types/lodash@^4.14.74":
version "4.14.74"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.74.tgz#ac3bd8db988e7f7038e5d22bd76a7ba13f876168"

"@types/minimatch@*":
version "2.0.29"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a"
Expand Down Expand Up @@ -1039,7 +1043,7 @@ loader-utils@^0.2.16:
json5 "^0.5.0"
object-assign "^4.0.1"

lodash@^4.14.0:
lodash@^4.14.0, lodash@^4.17.4:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"

Expand Down

0 comments on commit 48b91c7

Please sign in to comment.