我正在尝试将Bootstrap添加到Sinatra应用程序中.我有设置路由编译bootstrap.less和responsive.less.在Web浏览器中单独加载两个样式表按预期方式工作.但是当我尝试在html页面中使用它们时,我的应用程序就会挂起.我只能停止申请kill -9.
似乎以某种方式减少导入和多个样式表会导致应用程序挂起.我能够找出问题所在:
app.rb
require 'rubygems'
require 'bundler/setup'
require 'sinatra'
require 'less'
get '/' do
haml :index
end
get '/style1.css' do
less :style1, :paths => ['views']
end
get '/style2.css' do
less :style2, :paths => ['views']
end
Run Code Online (Sandbox Code Playgroud)
意见/ index.haml
!!! 5
%html
%head
%title Hello World
%link{'rel' => 'stylesheet', 'href' => 'style1.css', 'type' => 'text/css'}
%link{'rel' => 'stylesheet', 'href' => 'style2.css', 'type' => 'text/css'}
%body
%h1 Hello World
%p Hello World
Run Code Online (Sandbox Code Playgroud)
意见/ style1.less
@import "mixins.less"; …Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的单元测试从 Jasmine 转换为 Jest。一些测试在转换为 Jest 后开始失败。有人能解释一下为什么他们在 Jest 上失败了吗?
我设法将问题隔离到下面的测试用例中。
Jasmine 运行成功:
import { JasmineMarble } from './jasmine-marble';
import { cold } from 'jasmine-marbles';
import { switchMap } from 'rxjs/operators';
import { EMPTY, Observable } from 'rxjs';
class Service {
foo(): Observable<any> {
return EMPTY;
}
bar(a): Observable<any> {
return EMPTY;
}
}
describe('JasmineMarble', () => {
it('should create an instance', () => {
const service = new Service();
spyOn(service, 'foo').and.returnValue(cold('a|', { a: 'A' }));
spyOn(service, 'bar').and.returnValue(cold('a-b-c|', { a: 'A', b: …Run Code Online (Sandbox Code Playgroud)