<commit_before>###
	测试localService

	说明: 不再测试所用到的框架的功能

	@author: ijse
###

TEST_PORT = 3210

assert = require "assert"
Request = require "supertest"
localServer = require "../localServer"

# Set up local service
request = Request(localServer.create {
	path: {
		views: __dirname + "/res/views",
		public: __dirname + "/res/public",
		backend: __dirname + "/res/backend",
	},
	proxy: {
		enable: false
	}
})

describe "基本功能测试", ->
	describe "测试GET请求", ->
		it "请求静态文本内容", (done)->
			request
				.get("/test")
				.expect(200, "hello fed")
				.end(done)
		it "请求不存在的地址", (done)->
			request
				.get("/other")
				.expect(404, done)
		it "请求静态资源文件", (done)->
			request
				.get("/index.html")
				.expect(200, /<h1>hello static html file<\/h1>/, done)
	describe "测试POST请求", ->
		it "不带参数请求", (done)->
			request
				.post("/post")
				.expect(200, "hello fed")
				.end(done)<commit_msg>fix test spec<commit_after>###
	测试localService

	说明: 不再测试所用到的框架的功能

	@author: ijse
###

TEST_PORT = 3210

assert = require "assert"
Request = require "supertest"
localServer = require "../libs/core/localServer"

# Set up local service
request = Request(localServer.create {
	path: {
		view: __dirname + "/res/views",
		public: __dirname + "/res/public",
		mock: __dirname + "/res/backend",
	},
	proxy: {
		enable: false
	}
})

describe "基本功能测试", ->
	describe "测试GET请求", ->
		it "请求静态文本内容", (done)->
			request
				.get("/test")
				.expect(200, "hello fed")
				.end(done)
		it "请求不存在的地址", (done)->
			request
				.get("/other")
				.expect(404, done)
		it "请求静态资源文件", (done)->
			request
				.get("/index.html")
				.expect(200, /<h1>hello static html file<\/h1>/, done)
	describe "测试POST请求", ->
		it "不带参数请求", (done)->
			request
				.post("/post")
				.expect(200, "hello fed")
				.end(done)
{'fraction_non_alphanumeric': 0.18497757847533633, 'fraction_numerical': 0.020179372197309416, 'mean_word_length': 3.103448275862069, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5804595', 'n_tokens_mistral': 852, 'n_tokens_neox': 767, 'n_words': 157}