mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-12 19:26:13 +09:00
Revert "run jest-codemods on .spec.js files, move generator-exercises back in"
This reverts commit 7a001e0fdb.
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
'use strict';
|
||||
const Generator = require('yeoman-generator');
|
||||
const chalk = require('chalk');
|
||||
const yosay = require('yosay');
|
||||
|
||||
module.exports = class extends Generator {
|
||||
prompting() {
|
||||
// Have Yeoman greet the user.
|
||||
this.log(chalk.red('Let\'s do this'));
|
||||
|
||||
const prompts = [{
|
||||
type: 'input',
|
||||
name: 'title',
|
||||
message: 'Enter the exercise title',
|
||||
default: 'title'
|
||||
}];
|
||||
|
||||
return this.prompt(prompts).then(props => {
|
||||
// To access props later use this.props.someAnswer;
|
||||
this.props = props;
|
||||
});
|
||||
}
|
||||
|
||||
writing() {
|
||||
this.fs.copyTpl(
|
||||
this.templatePath(`title.js`),
|
||||
this.destinationPath(`${this.props.title}.js`),
|
||||
{title: this.props.title}
|
||||
);
|
||||
this.fs.copyTpl(
|
||||
this.templatePath(`title.spec.js`),
|
||||
this.destinationPath(`${this.props.title}.spec.js`),
|
||||
{title: this.props.title}
|
||||
);
|
||||
this.fs.copyTpl(
|
||||
this.templatePath(`README.md`),
|
||||
this.destinationPath(`README.md`),
|
||||
{title: this.props.title}
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1,2 +0,0 @@
|
||||
# Exercise XX - <%= title %>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<%= title %>
|
||||
@@ -1,5 +0,0 @@
|
||||
let <%= title %> = function() {
|
||||
|
||||
}
|
||||
|
||||
module.exports = <%= title %>
|
||||
@@ -1,8 +0,0 @@
|
||||
let <%= title %> = require('./<%=title%>')
|
||||
|
||||
describe('<%=title%>', function() {
|
||||
it('EDITME', function() {
|
||||
expect(<%=title%>()).toEqual(' ');
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user