- Download zip.
npm install
.npm test
.
Last active
June 11, 2017 21:30
-
-
Save eirikb/d8d9a20673166c02bf62 to your computer and use it in GitHub Desktop.
JSPM + AVA
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
Show hidden characters
{ | |
"presets": ["es2015"] | |
} |
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
'use strict'; | |
const glob = require('glob'); | |
const Module = require('module'); | |
const load = Module._load; | |
Module._load = (name, m) => { | |
try { | |
return load(name, m); | |
} catch (e) { | |
let files = glob(__dirname + '/jspm_packages/**/' + name + '*/', {sync: true}); | |
if (files.length > 0) return load(files[0], m); | |
} | |
}; |
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
{ | |
"name": "ava-test", | |
"version": "1.0.0", | |
"scripts": { | |
"postinstall": "jspm i -y", | |
"test": "ava" | |
}, | |
"devDependencies": { | |
"ava": "^0.11.0", | |
"glob": "^6.0.4", | |
"jspm": "^0.16.27" | |
}, | |
"jspm": { | |
"dependencies": { | |
"query-string": "npm:query-string@^3.0.0" | |
}, | |
"devDependencies": { | |
"babel": "npm:babel-core@^5.8.24", | |
"babel-runtime": "npm:babel-runtime@^5.8.24", | |
"core-js": "npm:core-js@^1.1.4" | |
} | |
}, | |
"ava": { | |
"files": [ | |
"./query-test.js" | |
], | |
"require": [ | |
"babel-core/register", | |
"./jspm-loader.js" | |
] | |
} | |
} |
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
import test from 'ava'; | |
import Query from './query'; | |
test(t => { | |
let res = Query.stringify({ | |
hello: 'world' | |
}); | |
t.is('hello=world', res); | |
}); |
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
import queryString from 'query-string'; | |
export default class Query { | |
static stringify(data) { | |
return queryString.stringify(data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment