(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
ENV["RAILS_ENV"] = "test" | |
require File.expand_path('../../config/environment', __FILE__) | |
require 'rails/test_help' | |
require 'minitest/autorun' | |
require 'minitest/pride' | |
require 'capybara/rails' | |
class MiniTest::Spec | |
include ActiveSupport::Testing::SetupAndTeardown |
ENV["RAILS_ENV"] = "test" | |
require File.expand_path('../../config/environment', __FILE__) | |
require 'rubygems' | |
gem 'minitest' | |
require 'minitest/autorun' | |
require 'action_controller/test_case' | |
require 'miniskirt' | |
require 'capybara/rails' |
source :rubygems | |
gem "sinatra", "~> 1.3.2" | |
group :test do | |
gem "minitest", "~> 2.10" | |
gem "rack-test", "~> 0.6.1" | |
gem "capybara", "~> 1.1" | |
gem "capybara-webkit", "~> 0.11" | |
gem "capybara_minitest_spec", "~> 0.2" |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
<script charset="utf-8"> | |
<% if ENV["RAILS_ENV"] == "production" %> | |
var script = "/react-app-bundle.js"; | |
<% else %> | |
console.warn("Development mode. Make sure to start 'node devServer.js'"); | |
var script = "http://" + (location.host || 'localhost').split(':')[0] + ":4000/react-app-bundle.js" | |
<% end %> | |
document.write('<script src="' + script + '"></' + 'script>'); | |
</script> |
It's quite straightforward to use GitLab Pages to deploy a Storybook instance per branch (and remove it whenever the branch will be removed). And yeah, it's irony to document this in a GitHub Gist 😅
You just need a .gitlab-ci.yml
like this one:
stages:
- setup
- build-and-test
- deployment
- pages
To avoid ../../../../../../filename.ts
garbage in the source code you can use Typescript Path Aliases.
This approach not only cleans up your imports but also helps when making refacoring and moving packages/modules around.
No matter where you will place your package, all imports allways will be resolvable.
But this is not enought at runtime. For example if you want to run WebPack dev-server. By default webpack does not know how to resolve those imports. You need to tweak WebPack config
Other resources: