mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
Added babel-node
This commit is contained in:
parent
fe72eddab1
commit
278e67ae75
6
js-jest/.babelrc
Normal file
6
js-jest/.babelrc
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"presets": ["@babel/preset-env"],
|
||||
"plugins": [
|
||||
["@babel/transform-runtime"]
|
||||
]
|
||||
}
|
||||
1
js-jest/.npmrc
Normal file
1
js-jest/.npmrc
Normal file
@ -0,0 +1 @@
|
||||
engine-strict=true
|
||||
3150
js-jest/package-lock.json
generated
3150
js-jest/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -2,8 +2,12 @@
|
||||
"name": "gilded-rose-kata",
|
||||
"version": "1.0.0",
|
||||
"description": "Gilded Rose kata in JavaScript with Jest",
|
||||
"engines": {
|
||||
"node": ">=12.18.0",
|
||||
"npm": ">=6.14.8"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node ./test/texttest_fixture.js",
|
||||
"start": "babel-node ./test/texttest_fixture.js",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:coverage": "jest --coverage"
|
||||
@ -24,14 +28,23 @@
|
||||
},
|
||||
"homepage": "https://github.com/emilybache/GildedRose-Refactoring-Kata",
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.12.1",
|
||||
"@babel/core": "^7.12.3",
|
||||
"@babel/node": "^7.12.1",
|
||||
"@babel/plugin-transform-runtime": "^7.12.1",
|
||||
"@babel/preset-env": "^7.12.1",
|
||||
"@babel/register": "^7.12.1",
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-loader": "^8.1.0",
|
||||
"jest": "^24.9.0",
|
||||
"standardx": "^5.0.0"
|
||||
},
|
||||
"standardx": {
|
||||
"parser": "babel-eslint",
|
||||
"env": [
|
||||
"node", "jest"
|
||||
"node",
|
||||
"jest"
|
||||
],
|
||||
"ignore": [
|
||||
"node_modules"
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Do not alter the Item class or Items property as those belong to the goblin in the corner who
|
||||
* will insta-rage and one-shot you as he doesn't believe in shared code ownership
|
||||
*/
|
||||
class Item {
|
||||
export class Item {
|
||||
constructor (name, sellIn, quality) {
|
||||
this.name = name
|
||||
this.sellIn = sellIn
|
||||
@ -11,7 +11,7 @@ class Item {
|
||||
}
|
||||
}
|
||||
|
||||
class RegularItem extends Item {
|
||||
export class RegularItem extends Item {
|
||||
constructor (itemProps) {
|
||||
const { name, sellIn, quality } = itemProps
|
||||
super(name, sellIn, quality)
|
||||
@ -52,7 +52,7 @@ class RegularItem extends Item {
|
||||
}
|
||||
}
|
||||
|
||||
class Shop {
|
||||
export class Shop {
|
||||
constructor (items = []) {
|
||||
this.items = items
|
||||
}
|
||||
@ -120,9 +120,3 @@ class Shop {
|
||||
return this.items
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
Item,
|
||||
Shop,
|
||||
RegularItem
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
const { RegularItem } = require('../src/gilded_rose')
|
||||
import { RegularItem } from '../src/gilded_rose'
|
||||
|
||||
// describe('Gilded Rose', function () {
|
||||
// it('should foo', function () {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
const { Shop, Item } = require('../src/gilded_rose')
|
||||
import { Shop, Item } from '../src/gilded_rose'
|
||||
|
||||
const items = [
|
||||
new Item('+5 Dexterity Vest', 10, 20),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user