-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
34 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
|
||
import each from 'each' | ||
import fs from 'fs' | ||
import path from 'path' | ||
import { exec } from 'child_process' | ||
|
||
import { fileURLToPath } from 'url' | ||
__dirname = path.dirname fileURLToPath import.meta.url | ||
dir = path.resolve __dirname, '../samples' | ||
samples = fs.readdirSync dir | ||
samples = fs.readdirSync(dir).filter (sample) -> /\.js$/.test sample | ||
|
||
describe 'Samples', -> | ||
|
||
samples.map (sample) -> | ||
return unless /\.js$/.test sample | ||
|
||
each samples, (sample) -> | ||
it "Sample #{sample}", (callback) -> | ||
exec "node #{path.resolve dir, sample}", (err) -> | ||
callback err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
|
||
import each from 'each' | ||
import fs from 'fs' | ||
import path from 'path' | ||
import { exec } from 'child_process' | ||
|
||
import { fileURLToPath } from 'url' | ||
__dirname = path.dirname fileURLToPath import.meta.url | ||
dir = path.resolve __dirname, '../samples' | ||
samples = fs.readdirSync dir | ||
[_, major] = process.version.match(/(\d+)\.\d+\.\d+/) | ||
samples = fs.readdirSync(dir) | ||
.filter (sample) -> ! (major < 16 && sample is 'recipe.promises.js') | ||
.filter (sample) -> /\.js$/.test sample | ||
|
||
describe 'Samples', -> | ||
|
||
samples | ||
.filter (sample) -> | ||
return false if major < 16 && sample is 'recipe.promises.js' | ||
true | ||
.map (sample) -> | ||
return unless /\.js$/.test sample | ||
|
||
each samples, (sample) -> | ||
it "Sample #{sample}", (callback) -> | ||
exec "node #{path.resolve dir, sample}", (err) -> | ||
callback err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
|
||
import { default as spectrum } from 'csv-spectrum' | ||
import { default as each } from 'each' | ||
import { parse } from '../lib/index.js' | ||
import { parse } from '../lib/sync.js' | ||
|
||
describe 'spectrum', -> | ||
|
||
it 'pass all tests', (next) -> | ||
spectrum (err, tests) -> | ||
each tests | ||
.call (test, next) -> | ||
return next() if test.name is 'simple' # See https://github.com/maxogden/csv-spectrum/commit/ec45e96a79661d7bd87f6becbb845b30f11accde | ||
parse test.csv.toString(), columns: true, (err, records) -> | ||
return next err if err | ||
records.should.eql JSON.parse test.json.toString() | ||
next() | ||
.next next | ||
each tests, (test) -> | ||
return if test.name is 'simple' # See https://github.com/maxogden/csv-spectrum/commit/ec45e96a79661d7bd87f6becbb845b30f11accde | ||
records = parse test.csv.toString(), columns: true | ||
records.should.eql JSON.parse test.json.toString() | ||
.then (-> next()), next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
|
||
import each from 'each' | ||
import fs from 'fs' | ||
import path from 'path' | ||
import { exec } from 'child_process' | ||
|
||
import { fileURLToPath } from 'url' | ||
__dirname = path.dirname fileURLToPath import.meta.url | ||
dir = path.resolve __dirname, '../samples' | ||
samples = fs.readdirSync dir | ||
samples = fs.readdirSync(dir).filter (sample) -> /\.js$/.test sample | ||
|
||
describe 'Samples', -> | ||
|
||
samples.map (sample) -> | ||
return unless /\.js$/.test sample | ||
|
||
each samples, (sample) -> | ||
it "Sample #{sample}", (callback) -> | ||
exec "node #{path.resolve dir, sample}", (err) -> | ||
callback err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
|
||
import each from 'each' | ||
import fs from 'fs' | ||
import path from 'path' | ||
import {exec} from 'child_process' | ||
import { exec } from 'child_process' | ||
|
||
import { fileURLToPath } from 'url' | ||
__dirname = path.dirname fileURLToPath import.meta.url | ||
dir = path.resolve __dirname, '../samples' | ||
samples = fs.readdirSync dir | ||
samples = fs.readdirSync(dir).filter (sample) -> /\.js$/.test sample | ||
|
||
describe 'Samples', -> | ||
|
||
samples.map (sample) -> | ||
return unless /\.js$/.test sample | ||
|
||
each samples, (sample) -> | ||
it "Sample #{sample}", (callback) -> | ||
exec "node #{path.resolve dir, sample}", (err) -> | ||
callback err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
|
||
import each from 'each' | ||
import fs from 'fs' | ||
import path from 'path' | ||
import { exec } from 'child_process' | ||
|
||
import { fileURLToPath } from 'url' | ||
__dirname = path.dirname fileURLToPath import.meta.url | ||
dir = path.resolve __dirname, '../samples' | ||
samples = fs.readdirSync dir | ||
samples = fs.readdirSync(dir).filter (sample) -> /\.js$/.test sample | ||
|
||
describe 'Samples', -> | ||
|
||
samples.map (sample) -> | ||
return unless /\.js$/.test sample | ||
|
||
each samples, (sample) -> | ||
it "Sample #{sample}", (callback) -> | ||
exec "node #{path.resolve dir, sample}", (err) -> | ||
callback err |